travis-web/AssetFile
2012-07-04 12:19:59 +02:00

99 lines
2.1 KiB
Plaintext

# TODO add neuter for production
# https://github.com/wycats/rake-pipeline-web-filters/blob/master/lib/rake-pipeline-web-filters/neuter_filter.rb
# http://blog.nulayer.com/post/23294069876/building-simple-javascript-libraries-with-rake-pipeline?15bb0420
require 'rake-pipeline-web-filters'
require 'compass'
Compass.configuration.images_path = 'assets/images'
output 'public/javascripts'
input 'assets/javascripts' do
match 'vendor/**/*.js' do
files = %w(
vendor/minispade.js
vendor/jquery.min.js
vendor/handlebars.js
vendor/ember.js
vendor/ember-data.js
vendor/ansiparse.js
vendor/i18n.js
vendor/facebox.js
vendor/jquery.timeago.js
vendor/sc-routes.js
)
concat files, 'vendor.js'
end
match '{app,config,data,lib}/**/*.coffee' do
coffee_script
end
match '**/*.hbs' do
handlebars(
:key_name_proc => proc { |input|
input.path.sub(%r(^app/templates/), '').sub(/\.hbs$/, '')
}
)
concat 'app/templates.js'
end
match '{app,config,data,lib}/**/*.js' do
minispade(
string: true,
rewrite_requires: true,
module_id_generator: proc { |input|
input.path.sub(%r(^(app|lib)/), '').sub(/\.js$/, '')
}
)
concat 'application.js'
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
output 'public/stylesheets'
input 'assets/stylesheets' do
match '**/*.{scss,sass}' do
# filter(Rake::Pipeline::Web::Filters::TiltFilter) do |input|
# input.sub /\.scss$/, '.css'
# end
filter Rake::Pipeline::Web::Filters::SassFilter
end
match '**/*.css' do
concat 'application.css'
end
end
output 'public/images'
input 'assets/images' do
match '**/*' do
copy
end
end
output 'public'
input 'assets/static' do
match '**/*' do
copy
end
end