rack-env 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/examples/{sample-sinatra-application → sinatra-application}/.env +0 -0
- data/examples/{sample-sinatra-application → sinatra-application}/Gemfile +0 -0
- data/examples/{sample-sinatra-application → sinatra-application}/app.rb +0 -0
- data/examples/{sample-sinatra-application → sinatra-application}/config.ru +0 -0
- data/lib/rack/env.rb +2 -2
- data/lib/rack/env/version.rb +1 -1
- data/spec/rack/env_spec.rb +6 -1
- data/spec/tmp/.env +1 -0
- metadata +8 -8
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/rack/env.rb
CHANGED
@@ -30,8 +30,8 @@ module Rack
|
|
30
30
|
def read_env_file(envfile)
|
31
31
|
::File.readlines(envfile).each {|line|
|
32
32
|
next if line.chomp == "" || line =~ /^#/
|
33
|
-
|
34
|
-
ENV[
|
33
|
+
parts = line.chomp.split('=')
|
34
|
+
ENV[parts[0]] = parts[1..-1].join('=')
|
35
35
|
} if ::File.exist?(envfile)
|
36
36
|
end
|
37
37
|
end
|
data/lib/rack/env/version.rb
CHANGED
data/spec/rack/env_spec.rb
CHANGED
@@ -56,13 +56,18 @@ describe 'Rack::Env' do
|
|
56
56
|
it "should ignore empty line and commented out line" do
|
57
57
|
expect{
|
58
58
|
request
|
59
|
-
}.to change{ ENV.size }.by(
|
59
|
+
}.to change{ ENV.size }.by(3)
|
60
60
|
end
|
61
61
|
|
62
62
|
it "should load environment variable" do
|
63
63
|
request
|
64
64
|
expect(ENV['JAPAN']).to eq "Tokyo"
|
65
65
|
end
|
66
|
+
|
67
|
+
it "should load environment variable with '=' inside" do
|
68
|
+
request
|
69
|
+
expect(ENV['SECRET_HASH']).to eq "123$@zzz?a=/b"
|
70
|
+
end
|
66
71
|
end
|
67
72
|
|
68
73
|
context "specified envfile" do
|
data/spec/tmp/.env
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-env
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-10-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
@@ -89,10 +89,10 @@ files:
|
|
89
89
|
- LICENSE
|
90
90
|
- README.md
|
91
91
|
- Rakefile
|
92
|
-
- examples/
|
93
|
-
- examples/
|
94
|
-
- examples/
|
95
|
-
- examples/
|
92
|
+
- examples/sinatra-application/.env
|
93
|
+
- examples/sinatra-application/Gemfile
|
94
|
+
- examples/sinatra-application/app.rb
|
95
|
+
- examples/sinatra-application/config.ru
|
96
96
|
- lib/rack/env.rb
|
97
97
|
- lib/rack/env/version.rb
|
98
98
|
- rack-env.gemspec
|
@@ -114,7 +114,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
114
114
|
version: '0'
|
115
115
|
segments:
|
116
116
|
- 0
|
117
|
-
hash: -
|
117
|
+
hash: -4391156441659915844
|
118
118
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
119
119
|
none: false
|
120
120
|
requirements:
|
@@ -123,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
123
|
version: '0'
|
124
124
|
segments:
|
125
125
|
- 0
|
126
|
-
hash: -
|
126
|
+
hash: -4391156441659915844
|
127
127
|
requirements: []
|
128
128
|
rubyforge_project:
|
129
129
|
rubygems_version: 1.8.23
|