
-
Recent Posts
Categories
Category Archives: rails
Skipping asset precompilation in capistrano if the assets did not change
The default capistrano task for compiling the assets compiles them every time, regardless of whether any assets were changed in the set of commits that you are deploying. This is the code snippet I use to check if the assets … Continue reading
Posted in rails
Leave a comment
Rake task with arguments and :environment
Just a quick tip: desc "Rake task with arguments and :environment" task :task_name, [:arg1, :arg2] => :environment do |t, args| args.with_defaults(:arg1 => "Foo", :arg2 => "Bar") puts "Hello, #{args.arg1}. Bye, #{args.arg2}." end Notes: You may omit the #with_defaults call. You … Continue reading