diff options
author | Joshua Peek <josh@joshpeek.com> | 2011-03-21 18:05:56 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2011-03-21 18:05:56 -0500 |
commit | 77ad4ca058c9a845257cbeb58a84cf511bae1040 (patch) | |
tree | 5dddfb6671276b562ac237e8682585a87d0db6cc /railties/lib/rails/tasks | |
parent | 3e7985c9c1a6899ac06857bd8e6f29b48ad87cea (diff) | |
download | rails-77ad4ca058c9a845257cbeb58a84cf511bae1040.tar.gz rails-77ad4ca058c9a845257cbeb58a84cf511bae1040.tar.bz2 rails-77ad4ca058c9a845257cbeb58a84cf511bae1040.zip |
Add sprockets task to compile assets
Diffstat (limited to 'railties/lib/rails/tasks')
-rw-r--r-- | railties/lib/rails/tasks/assets.rake | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/railties/lib/rails/tasks/assets.rake b/railties/lib/rails/tasks/assets.rake new file mode 100644 index 0000000000..b6604a49c2 --- /dev/null +++ b/railties/lib/rails/tasks/assets.rake @@ -0,0 +1,14 @@ +namespace :assets do + task :compile => :environment do + env = Rails.application.assets + + assets = Rails.root.join("public/assets") + assets.mkdir unless assets.exist? + + Rails.application.config.compile_assets.each do |path| + assets.join(path).open('w') do |f| + f.write env[path].to_s + end + end + end +end |