lib/rocketio.rb in rocketio-0.2.0 vs lib/rocketio.rb in rocketio-0.2.1
- old
+ new
@@ -12,26 +12,26 @@
module RocketIO
extend self
ENVIRONMENTS = {
- 'development' => :development,
- 'testing' => :testing,
- 'stage' => :stage,
- 'production' => :production
+ 'development' => 'development'.freeze,
+ 'testing' => 'testing'.freeze,
+ 'stage' => 'stage'.freeze,
+ 'production' => 'production'.freeze,
}.freeze
- environment = ENV['APP_ENV'] || ENV['RACK_ENV'] || ENVIRONMENTS.keys[0]
+ environment = ENV['APP_ENV'] || ENV['RACK_ENV'] || ENVIRONMENTS.values[0]
unless ENVIRONMENT = ENVIRONMENTS[environment]
raise(StandardError, '%s environment not supported. Use one of %s' % [environment.inspect, ENVIRONMENTS.keys*', '])
end
def environment
ENVIRONMENT
end
ENVIRONMENTS.each_value do |env|
- define_method(env.to_s + '?') {ENVIRONMENT == env}
+ define_method(env + '?') {ENVIRONMENT == env}
end
GET = 'GET'.freeze
POST = 'POST'.freeze
PUT = 'PUT'.freeze