Class: Yeller::StartupParams

Inherits:
Object
  • Object
show all
Defined in:
lib/yeller/startup_params.rb

Constant Summary collapse

PRODUCTION =
'production'.freeze
VERSION =
"yeller_rubby: #{Yeller::VERSION}"

Class Method Summary collapse

Class Method Details

.application_environment(options) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/yeller/startup_params.rb', line 16

def self.application_environment(options)
  options[:"application-environment"] ||
    ENV['RAILS_ENV'] ||
    ENV['RACK_ENV'] ||
    ((defined?(::Rails) && Rails.respond_to?(:env)) ? Rails.env.to_s : nil) ||
    PRODUCTION
end

.defaults(options = {}) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/yeller/startup_params.rb', line 8

def self.defaults(options={})
  {
    :host => Socket.gethostname,
    :"application-environment" => application_environment(options),
    :"client-version" => VERSION,
  }
end