Module: Racknga::Utils — racknga - ラングバ

Module: Racknga::Utils

Defined in:
lib/racknga/utils.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) normalize_options(options)



31
32
33
34
35
36
37
38
# File 'lib/racknga/utils.rb', line 31

def normalize_options(options)
  normalized_options = {}
  options.each do |key, value|
    value = normalize_options(value) if value.is_a?(Hash)
    normalized_options[key.to_sym] = value
  end
  normalized_options
end

- (Boolean) passenger?

Returns:

  • (Boolean)


26
27
28
29
# File 'lib/racknga/utils.rb', line 26

def passenger?
  ENV["PASSENGER_ENVIRONMENT"] or
    /Phusion_Passenger/ =~ ENV["SERVER_SOFTWARE"].to_s
end

- (Boolean) production?

Returns:

  • (Boolean)


22
23
24
# File 'lib/racknga/utils.rb', line 22

def production?
  ENV["RACK_ENV"] == "production"
end