Created
January 11, 2013 11:14
-
-
Save jondot/4509939 to your computer and use it in GitHub Desktop.
Assetfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rake-pipeline-web-filters' | |
output "public" | |
class Rake::Pipeline::DSL::PipelineDSL | |
def production? | |
ENV['RAKEP_MODE'] == 'production' | |
end | |
end | |
input "assets/javascripts" do | |
match "app/**/*.coffee" do | |
coffee_script | |
end | |
match "app/**/*.js" do | |
minispade :rewrite_requires => true, :module_id_generator => proc { |input| | |
input.path.sub(/^app\//, '').sub(/\.js$/, '') | |
} | |
uglify if production? | |
concat "application.js" | |
end | |
match "vendor/**/*.js" do | |
uglify if production? | |
concat %w[ | |
vendor/jquery.js | |
vendor/handlebars.js | |
vendor/ember.js | |
], "application.js" | |
end | |
end | |
input "assets/stylesheets" do | |
match "**/*.sass" do | |
sass | |
end | |
match "**/*.css" do | |
yui_css if production? | |
concat "application.css" | |
end | |
end | |
# Finally, we keep our static assets that don't need any processing | |
# in a `static/` directory. | |
input "assets/static" do | |
match "**/*" do | |
# The block we pass to `concat` lets us adjust the output path | |
# of any files it matches. Here we take each input and strip | |
# off the `static/` prefix, so `app/static/index.html` ends up | |
# in `public/index.html`. | |
concat do |input| | |
input.sub(/static\//, '') | |
end | |
end | |
end | |
# vim:ft=ruby |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment