rack-reqorder 0.4.4 → 0.4.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f3f1f32765fce26c4878bb91c079c0f2c872a443
4
- data.tar.gz: 5a55f3346fa2dc1fc7525494fb7feca078fa5802
3
+ metadata.gz: 8aaa33de9cc216e66802198be6c4eb3aafbbc453
4
+ data.tar.gz: e9a69f17188d9776f42948acda236d7142262b24
5
5
  SHA512:
6
- metadata.gz: 7c168e517621cbfe95767349876ebc8ca315150c0574cfb6e5c19635225a1a50948edc2f91acce93ba96e93712cfdc77be50d27a8bb99b41d5016e614548890c
7
- data.tar.gz: 655dca00775c4813f2d4a014426e947378c9cfce30f8bb0845886b5a775d647fb329a450c5f8a81091844a5a5b7791698f6d1ec9b78b33a4831f665b172673b2
6
+ metadata.gz: fabe83231f9d66330649e883396393ead00db6af977367d3e7483afb951d4d162f1150d3b8bb24e5caf2c59dd97d25711f19134a4d9c716c4de79403b6c3de13
7
+ data.tar.gz: 598a5706b6e18aec2a3ce8d0e4ddb3071ca3c4053b687bd60347eb861e78f9962ac8c348c68da01ddae1b6be8a97a2b18a1a4af1125126a45ce3c81dc529cced
data/lib/rack/reqorder.rb CHANGED
@@ -39,14 +39,21 @@ module Rack
39
39
  end
40
40
 
41
41
  if environment.blank?
42
- puts 'rack-reqorder: No environment found, assuming development environment'
43
- self.environment = :development
42
+ self.environment = app_environment
44
43
  end
45
44
 
46
45
  self.auth_email = 'admin@example.com' if auth_email.blank?
47
46
  self.auth_password = 'password' if auth_password.blank?
48
47
  self.no_auth = false if self.no_auth.blank?
49
48
  end
49
+
50
+ def app_environment
51
+ if Module.const_defined?(:Rails)
52
+ return Rails.env
53
+ else
54
+ return ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'staging'
55
+ end
56
+ end
50
57
  end
51
58
  end
52
59
  end
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  module Reqorder
3
- VERSION = "0.4.4"
3
+ VERSION = "0.4.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-reqorder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Filippos Vasilakis