Method: DBGeni::Config#current_env
- Defined in:
- lib/dbgeni/config.rb
permalink #current_env ⇒ Object
[View source]
114 115 116 117 118 119 120 121 122 |
# File 'lib/dbgeni/config.rb', line 114 def current_env if @current_environment @environments[@current_environment] elsif @environments.keys.reject{|i| i == DEFAULTS_ENV}.length == 1 @environments[@environments.keys.reject{|i| i == DEFAULTS_ENV}.first] else raise DBGeni::ConfigAmbiguousEnvironment, "More than one environment is defined" end end |