Jump start your application by base jumping your app.
$ gem install base_jump
$ gem 'base_jump'
$ require 'base_jump'
module MyApp
module App
end
end
BaseJump.init MyApp::App
BaseJump will look for an environment variable named MYAPP_ENV
to determine the environment.
BaseJump attempts to provide sensible defaults for all configuration options, but any/all of the following may be overridden in the individual environment files.
config/environments/development.rb:
MyApp::App.configure do |config|
config.log_destination = path_to_log
config.logger = my_logger
end
MyApp::App.env.test?
will exist
if there is a config/environments/test.rb
file.
MyApp::App.environment #=> :development
MyApp::App.environment = 'test'
will set the value
of the environment variable.
This value will be a lower case symbol.
# Starting values
MyApp::App.environment #=> :development
ENV['MYAPP_ENV'] #=> 'development'
# Set environment to test
MyApp::App.environment = 'TeSt'
MyApp::App.environment #=> :test
ENV['MYAPP_ENV'] #=> 'test'