This file contains hidden or 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
# generate profile around a script/test | |
$ CPUPROFILE=/tmp/my_app_profile RUBYOPT="-r`gem which perftools | tail -1`" ruby -I spec spec/models/user_role_spec.rb | |
# generate profile using a block | |
# (this is in ruby obviously) | |
require 'perftools' | |
PerfTools::CpuProfiler.start("/tmp/add_numbers_profile") do | |
5_000_000.times{ 1+2+3+4+5 } | |
end |
This file contains hidden or 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
# add to config/initializers | |
if hostname =~ /qa/ || Rails.env.staging? | |
class OverrideMailRecipient | |
def self.delivering_email(mail) | |
mail.to = "[email protected]" | |
end | |
end | |
ActionMailer::Base.register_interceptor(OverrideMailRecipient) | |
end |
This file contains hidden or 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
# More info at https://github.com/guard/guard#readme | |
guard 'spork', :cucumber => false, :test_unit => false, :rspec_env => { 'RAILS_ENV' => 'test' } do | |
watch('config/application.rb') | |
watch('config/environment.rb') | |
watch(%r{^config/environments/.+\.rb$}) | |
watch(%r{^config/initializers/.+\.rb$}) | |
watch('spec/spec_helper.rb') | |
end |
NewerOlder