denv 0.2.5 → 0.2.6

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: 8ec0793ffe91ad8bc83012fdd947b8eb5f4ce0bb
4
- data.tar.gz: 46958e78bcd24d5dff808637c0bae4484652d280
3
+ metadata.gz: a41043d097851fba8d5cf225af1b0729df840c12
4
+ data.tar.gz: ab5f2fd89e6eeac99f950954c5ae1a7946454982
5
5
  SHA512:
6
- metadata.gz: 78b1f47c7219c9b45c08397ff876a1f92a34bbc6f58e2ef2319217dbfb771f260dc60a105e09de4627701e35dda325b52b723eb5df3e264f1284c9f7d249ecd9
7
- data.tar.gz: 2d22d829aa41761fd1dff0328db0924cf299eca90cfeea4ba4ffb62a15d8559c5dc0a6b04a728926a89978fd0dc9436c4c1e9b9cf2f7bc21903e804f175cd5d5
6
+ metadata.gz: e4b8de6e2f7f2395dbfcf74ef2f3dca17c29cc80b077cc311e79f56b0e17f3f44572db0db29a8329972243c393a5e1a3949b1f7e6514d309ba9f554b501e158e
7
+ data.tar.gz: 6eff8e3897153a22964552133b97efb6181a2fbb6f543b093cd00109646c7a5262f8d80cf0254eab2870c097c55e0178a89fe0fe302dede5ddf3cf728c5fb4a7
data/.gitignore CHANGED
@@ -10,3 +10,4 @@
10
10
  /spec/examples.txt
11
11
  /.env
12
12
  /tmp
13
+ .ruby-version
@@ -5,7 +5,6 @@ branches:
5
5
  only:
6
6
  - master
7
7
  rvm:
8
- - "2.0"
9
- - "2.1"
10
- - "2.2"
11
- - "2.3.0"
8
+ - "2.2.7"
9
+ - "2.3.4"
10
+ - "2.4.1"
@@ -1,4 +1,7 @@
1
1
  # CHANGELOG.md for denv
2
+ ## 0.2.6
3
+ - Correctly load `.env.#{Rails.env}` files.
4
+
2
5
  ## 0.2.5
3
6
  - Correct loading order to overwirte default one #3
4
7
 
@@ -19,6 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ['lib']
20
20
 
21
21
  spec.add_development_dependency 'bundler'
22
+ spec.add_development_dependency 'pry-byebug'
22
23
  spec.add_development_dependency 'rails'
23
24
  spec.add_development_dependency 'rake'
24
25
  spec.add_development_dependency 'rspec', '~> 3'
@@ -13,7 +13,7 @@ end
13
13
 
14
14
  module Denv
15
15
  class Railtie < ::Rails::Railtie
16
- DEFAULT_ENV_FILES = %w[.env .env.#{Rails.env} .env.local]
16
+ DEFAULT_ENV_FILES = %W[.env .env.#{Rails.env} .env.local]
17
17
 
18
18
  config.before_configuration { load_env }
19
19
 
@@ -1,3 +1,3 @@
1
1
  module Denv
2
- VERSION = '0.2.5'
2
+ VERSION = '0.2.6'
3
3
  end
@@ -13,13 +13,27 @@ Dir.chdir('tmp') do
13
13
  raise('Necessary keys are removed') unless ENV.has_key?('INIT')
14
14
  raise('Can not set env') unless ENV['YYY'] == '2'
15
15
 
16
- File.write('.env', "XXX=1\n")
16
+ File.write('.env', "XXX=\nYYY=3\nZZZ=4")
17
17
  code = <<-EOS
18
18
  $LOAD_PATH.unshift("#{lib}")
19
19
  require 'denv'
20
20
  Denv.load
21
- raise('Previous env vars are not removed') if ENV.has_key?('YYY')
22
- raise('Necessary keys are removed') unless ENV.has_key?('XXX')
21
+
22
+ if ENV['XXX'] != ''
23
+ p ENV
24
+ raise('Previous env vars are not removed')
25
+ end
26
+
27
+ if ENV['YYY'] != '3'
28
+ p ENV
29
+ raise('can not overwrite env var')
30
+ end
31
+
32
+ if ENV['ZZZ'] != '4'
33
+ p ENV
34
+ raise('can not add new env var')
35
+ end
36
+
23
37
  puts 'Success'
24
38
  EOS
25
39
  exec('ruby', '-e', code)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: denv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taiki Ono
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-05-12 00:00:00.000000000 Z
11
+ date: 2017-10-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: pry-byebug
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: rails
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -126,10 +140,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
126
140
  version: '0'
127
141
  requirements: []
128
142
  rubyforge_project:
129
- rubygems_version: 2.6.3
143
+ rubygems_version: 2.5.2
130
144
  signing_key:
131
145
  specification_version: 4
132
146
  summary: Loads environment variables to `ENV` from `.env` file. No special treatments
133
147
  about shell meta characters.
134
148
  test_files: []
135
- has_rdoc: