Module: Archfiend::Utilities
- Defined in:
- lib/archfiend/application.rb
Instance Method Summary collapse
- #app ⇒ Object
- #env ⇒ Object
-
#groups(*groups) ⇒ Array<string>
Returns all dependency groups for loading based on: * The App environment; * The environment variable APP_GROUPS;.
- #logger ⇒ Object
Instance Method Details
#app ⇒ Object
111 112 113 |
# File 'lib/archfiend/application.rb', line 111 def app @app ||= const_get('Application').new end |
#env ⇒ Object
115 116 117 |
# File 'lib/archfiend/application.rb', line 115 def env ENV['APP_ENV'] || ENV['RAILS_ENV'] || 'development' end |
#groups(*groups) ⇒ Array<string>
Returns all dependency groups for loading based on:
-
The App environment;
-
The environment variable APP_GROUPS;
123 124 125 126 127 128 129 130 |
# File 'lib/archfiend/application.rb', line 123 def groups(*groups) groups.unshift(:default, env.to_sym) env_groups = ENV['APP_GROUPS'] || ENV['RAILS_GROUPS'] groups.concat env_groups.to_s.split(',') groups.compact! groups.uniq! groups end |