dotenv 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Changelog.md +5 -0
- data/README.md +1 -0
- data/dotenv.gemspec +1 -1
- data/lib/dotenv/environment.rb +1 -1
- data/lib/dotenv/railtie.rb +7 -2
- data/spec/dotenv_spec.rb +6 -0
- metadata +5 -4
data/Changelog.md
ADDED
data/README.md
CHANGED
data/dotenv.gemspec
CHANGED
data/lib/dotenv/environment.rb
CHANGED
data/lib/dotenv/railtie.rb
CHANGED
@@ -1,11 +1,16 @@
|
|
1
1
|
module Dotenv
|
2
2
|
class Railtie < Rails::Railtie
|
3
3
|
rake_tasks do
|
4
|
-
|
4
|
+
desc 'Load environment settings from .env'
|
5
|
+
task :dotenv do
|
6
|
+
Dotenv.load ".env.#{Rails.env}", '.env'
|
7
|
+
end
|
8
|
+
|
9
|
+
task :environment => :dotenv
|
5
10
|
end
|
6
11
|
|
7
12
|
initializer 'dotenv', :group => :all do
|
8
|
-
Dotenv.load
|
13
|
+
Dotenv.load ".env.#{Rails.env}", '.env'
|
9
14
|
end
|
10
15
|
end
|
11
16
|
end
|
data/spec/dotenv_spec.rb
CHANGED
@@ -59,6 +59,12 @@ describe Dotenv do
|
|
59
59
|
subject.apply
|
60
60
|
expect(ENV['OPTION_A']).to eq('1')
|
61
61
|
end
|
62
|
+
|
63
|
+
it 'does not override defined variables' do
|
64
|
+
ENV['OPTION_A'] = 'predefined'
|
65
|
+
subject.apply
|
66
|
+
expect(ENV['OPTION_A']).to eq('predefined')
|
67
|
+
end
|
62
68
|
end
|
63
69
|
end
|
64
70
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dotenv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
8
|
+
- 3
|
9
9
|
- 0
|
10
|
-
version: 0.
|
10
|
+
version: 0.3.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Brandon Keepers
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-
|
18
|
+
date: 2012-10-25 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: rake
|
@@ -57,6 +57,7 @@ extra_rdoc_files: []
|
|
57
57
|
files:
|
58
58
|
- .env
|
59
59
|
- .gitignore
|
60
|
+
- Changelog.md
|
60
61
|
- Gemfile
|
61
62
|
- LICENSE
|
62
63
|
- README.md
|