Module: Archfiend::Utilities

Defined in:
lib/archfiend/application.rb

Instance Method Summary collapse

Instance Method Details

#appObject



111
112
113
# File 'lib/archfiend/application.rb', line 111

def app
  @app ||= const_get('Application').new
end

#envObject



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;

Returns:

  • (Array<string>)

    All gem groups that needs to be included for current env



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

#loggerObject



107
108
109
# File 'lib/archfiend/application.rb', line 107

def logger
  @logger ||= Archfiend::Logging.create(env, root.join('log'))
end