make assetfile reusable

This commit is contained in:
Sven Fuchs 2012-10-03 16:27:20 +02:00
parent b8be2678c0
commit 9440ccaf7d
8 changed files with 1527 additions and 9978 deletions

View File

@ -4,13 +4,15 @@ require 'rake-pipeline-web-filters'
require 'rake-pipeline/travis'
require 'compass'
roots ||= [Pathname.new(File.expand_path('.'))]
Compass.configuration.images_path = 'assets/images'
Compass.configuration.add_import_path File.expand_path('../assets/stylesheets', __FILE__)
Travis::Version.update
output 'public/javascripts'
input 'assets/javascripts' do
input roots.map { |root| root.join('assets/javascripts').to_s } do
match 'app/templates/**/*.hbs' do
filter Travis::HandlebarsFilter
concat 'app/templates.js'
@ -33,7 +35,7 @@ input 'assets/javascripts' do
match 'min/**/*.js' do
filter Travis::ProductionFilter
uglify max_line_length: 50, squeeze: true
uglify max_line_length: 32 * 1024, squeeze: true
filter Travis::SafeConcatFilter do
'application.min.js'
end
@ -45,7 +47,7 @@ input 'assets/javascripts' do
end
output 'public/stylesheets'
input 'assets/stylesheets' do
input roots.map { |root| root.join('assets/stylesheets').to_s } do
match '**/*.{scss,sass}' do
filter Rake::Pipeline::Web::Filters::SassFilter
concat [], 'application.css'
@ -53,33 +55,15 @@ input 'assets/stylesheets' do
end
output 'public/images'
input 'assets/images' do
input roots.map { |root| root.join('assets/images').to_s } do
match '**/*' do
copy
end
end
output 'public'
input 'assets/static' do
input roots.map { |root| root.join('assets/public').to_s } do
match '**/*' do
copy
end
end
# # DOH. how to simplify this.
# input 'assets/javascripts/spec' do
# match 'vendor/*.js' do
# files = %w(
# vendor/jasmine.js
# vendor/jasmine-html.js
# vendor/jasmine-runner.js
# vendor/sinon.js
# )
# concat files, 'specs/vendor.js'
# end
#
# match '**/*.coffee' do
# coffee_script
# concat 'specs/specs.js'
# end
# end

View File

@ -42,7 +42,7 @@ GIT
GIT
remote: git://github.com/travis-ci/travis-api.git
revision: f6957636fba447ed61565e16a466eed8325900a5
revision: c9c9dc61d8e2f24b331fd0e1b1549aff32178b29
specs:
travis-api (0.0.1)
backports (~> 2.5)

View File

@ -1,7 +1,7 @@
$: << 'lib'
guard 'assets' do
watch(%r(^AssetFile))
watch(%r(^Assetfile))
watch(%r(^assets))
end

View File

@ -1,18 +1,23 @@
require 'rake-pipeline'
require 'execjs'
require 'uglifier'
require 'pathname'
module Travis
class HandlebarsFilter < Rake::Pipeline::Filter
class << self
def source
[
File.read('lib/rake-pipeline/ember-headless.js'),
File.read('assets/javascripts/vendor/handlebars.js'),
File.read('assets/javascripts/vendor/ember.js')
File.read(root.join('lib/rake-pipeline/ember-headless.js')),
File.read(root.join('assets/javascripts/vendor/handlebars.js')),
File.read(root.join('assets/javascripts/vendor/ember.js'))
].join("\n")
end
def root
@root ||= Pathname.new(File.expand_path('../../../../', __FILE__))
end
def context
@@context ||= ExecJS.compile(source)
end

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -1 +1 @@
73435ff6
c192dd6c