Permalink
Browse files

execute assets:precompile on rails 3 apps

  • Loading branch information...
1 parent e375139 commit bc90eebcdaa4b30053f4712978b2eef797391800 @hone hone committed with hone Jun 9, 2011
Showing with 13 additions and 0 deletions.
  1. +13 −0 lib/language_pack/rails3.rb
@@ -3,6 +3,8 @@
class LanguagePack::Rails3 < LanguagePack::Rails2
+ JS_RUNTIME_PATH = File.expand_path(File.join(File.dirname(__FILE__), '../../vendor/node/node-0.4.7'))
+
def self.use?
super &&
File.exists?("config/application.rb") &&
@@ -26,6 +28,7 @@ def default_process_types
def compile
super
+ run_assets_precompile_task
end
private
@@ -34,5 +37,15 @@ def plugins
super.concat(%w( rails3_serve_static_assets )).uniq
end
+ def run_assets_precompile_task
+ if rake_task_defined?("assets:precompile")
+ topic("Running assets:precompile task")
+ pipe("PATH=$PATH:#{JS_RUNTIME_PATH} bundle exec rake assets:precompile 2>&1")
+ unless $?.success?
+ error "assets:precompile task failed"
+ end
+ end
+ end
+
end

0 comments on commit bc90eeb

Please sign in to comment.