rails_env_local 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/rails_env_local/rails_env.rb +10 -2
- data/lib/rails_env_local/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c7cfa038a63925d452456e9b2bb09c1e2963930f
|
4
|
+
data.tar.gz: 268d97f54280d3c6b438a066252ec00dc06c86df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ca87c74abb007b27a056ffb0b404c2f5a957462f73bfa110f94b86f274873aca774b3d844adb208b6aa1e594217e0afe54c309278bb491d8dbeab93b8240b9b
|
7
|
+
data.tar.gz: b7e6ac96e054cbe935cbc0d9bd963f37c07dfa8dab9eba1b21527d049ee81afe22e32e87473d9cc95c8a3735908eba5f09798daf089c373f36ed956d0ef89dac
|
data/README.md
CHANGED
@@ -55,13 +55,13 @@ NOTE: If you need your custom local environment to be set before some of the oth
|
|
55
55
|
|
56
56
|
## Compatibility
|
57
57
|
|
58
|
-
This gem
|
58
|
+
This gem works with any version of Rails that uses `Rails.env`, *but* it is only tested with Rails 3.2, 4.1, 4.2, and 5.0.
|
59
59
|
|
60
60
|
This gem is tested with Ruby 2.2-latest and 2.3-latest. It should work with any version of Ruby that supports both Ruby 1.9 hashes and double splat arguments.
|
61
61
|
|
62
62
|
## Theory
|
63
63
|
|
64
|
-
### Q: Why not just "local"?
|
64
|
+
### Q: Why not just "local" as the default?
|
65
65
|
|
66
66
|
A: It is too generic. "local" is often used in the same ordinal position as, but with a different meaning than, the environment name. For one example of this see: https://github.com/bkeepers/dotenv#multiple-rails-environments
|
67
67
|
|
@@ -3,12 +3,20 @@ module RailsEnvLocal
|
|
3
3
|
module RailsEnv
|
4
4
|
def env
|
5
5
|
result = super
|
6
|
-
|
6
|
+
case result
|
7
|
+
when "development" then
|
7
8
|
msg = %[WARNING: environment is incorrectly "development". Early access of Rails.env might be the cause, consider moving `RailsEnvLocal.set_local_environment` up in config/boot.rb]
|
8
9
|
warn(msg)
|
9
10
|
Rails.logger.error(msg) if Rails.logger
|
11
|
+
when "local"
|
12
|
+
msg = %[WARNING: environment name "local" is partly incompatible with dotenv gem, and probably others]
|
13
|
+
warn(msg)
|
14
|
+
Rails.logger.error(msg) if Rails.logger
|
15
|
+
else
|
16
|
+
# If other bad environment names are found add them to the case statement.
|
17
|
+
# Share the knowledge about environment name incompatibility!
|
10
18
|
end
|
11
19
|
result
|
12
20
|
end
|
13
21
|
end
|
14
|
-
end
|
22
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_env_local
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Boling
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|