guard-rails-assets/lib/guard/rails-assets/cli_runner.rb

16 lines
409 B
Ruby
Raw Permalink Normal View History

module Guard
class RailsAssets::CliRunner
def initialize(options={})
@rails_env = (options[:rails_env] || 'test').to_s
2011-10-10 22:43:08 +00:00
@digest = options[:digest]
@digest = true if @digest.nil?
end
def compile_assets
2011-10-10 22:43:08 +00:00
task = "assets:precompile"
task += ":nondigest" unless @digest
system "bundle exec rake assets:clean #{task} RAILS_ENV=#{@rails_env}"
end
end
end