Method: Bj::API#in
- Defined in:
- lib/bj/api.rb
#in(rails_env = Bj.rails_env, &block) ⇒ Object
this method changes the context under which bj is operating. a context is a RAILS_ENV. the method accepts a block and it used to alter the behaviour of the bj lib on a global scale such that all operations, spawning of background runnner processes, etc, occur in that context.
eg:
Bj.in :production do
Bj.submit './script/runner ./scripts/facebook_notification.rb'
end
Bj.in :development do
Bj.submit 'does_this_eat_memory.exe'
end
84 85 86 |
# File 'lib/bj/api.rb', line 84 def in rails_env = Bj.rails_env, &block transaction(:rails_env => rails_env.to_s, &block) end |