86 lines
1.9 KiB
Plaintext
86 lines
1.9 KiB
Plaintext
$: << 'lib'
|
|
|
|
require 'rake-pipeline-web-filters'
|
|
require 'rake-pipeline/travis'
|
|
require 'compass'
|
|
|
|
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
|
|
match 'app/templates/**/*.hbs' do
|
|
filter Travis::HandlebarsFilter
|
|
concat 'app/templates.js'
|
|
end
|
|
|
|
match %r(\.coffee$) do
|
|
coffee_script
|
|
end
|
|
|
|
match %r(^(travis|(app|config|data|lib)/.*)\.js$) do
|
|
modules = proc { |input| input.path.gsub(%r((^app/|^lib/|\.js$)), '') }
|
|
minispade(string: true, rewrite_requires: true, module_id_generator: modules)
|
|
concat [], ['dev/app.js', 'min/app.js']
|
|
end
|
|
|
|
match 'vendor/**/*.js' do
|
|
precedence = %w(jquery.min minispade handlebars ember).map { |name| "vendor/#{name}.js" }
|
|
concat precedence, ['dev/vendor.js', 'min/vendor.js']
|
|
end
|
|
|
|
match 'min/**/*.js' do
|
|
filter Travis::ProductionFilter
|
|
uglify max_line_length: 50, squeeze: true
|
|
filter Travis::SafeConcatFilter do
|
|
'application.min.js'
|
|
end
|
|
end
|
|
|
|
match 'dev/**/*.js' do
|
|
concat 'application.js'
|
|
end
|
|
end
|
|
|
|
output 'public/stylesheets'
|
|
input 'assets/stylesheets' do
|
|
match '**/*.{scss,sass}' do
|
|
filter Rake::Pipeline::Web::Filters::SassFilter
|
|
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
|
|
|
|
# # 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
|