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 +4 -4
- data/lib/rack/reqorder.rb +9 -2
- data/lib/rack/reqorder/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8aaa33de9cc216e66802198be6c4eb3aafbbc453
|
4
|
+
data.tar.gz: e9a69f17188d9776f42948acda236d7142262b24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|