Method: DBGeni::Config#environment
- Defined in:
- lib/dbgeni/config.rb
#environment(name, &block) ⇒ Object
Given a block of environment details, generate a new environment object. eg environment(‘some_name’) do
database ''
user ''
password prompt
some_dir_path '/path_to_directory'
281 282 283 284 285 286 287 288 289 290 |
# File 'lib/dbgeni/config.rb', line 281 def environment(name, &block) env = Environment.new(name) block.arity < 1 ? env.instance_eval(&block) : block.call(env) env.__completed_loading if @environments.has_key?(name) @environments[name].__merge_environment(env) else @environments[name] = env end end |