rack-env 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
- key, value = line.chomp.split('=')
34
- ENV[key] = value
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
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  class Env
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.3"
4
4
  end
5
5
  end
@@ -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(2)
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
@@ -1,4 +1,5 @@
1
1
  JAPAN=Tokyo
2
2
 
3
3
  BRAZIL=Brasilia
4
+ SECRET_HASH=123$@zzz?a=/b
4
5
  # AUSTRARIA=Canberra
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.2
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-08-30 00:00:00.000000000 Z
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/sample-sinatra-application/.env
93
- - examples/sample-sinatra-application/Gemfile
94
- - examples/sample-sinatra-application/app.rb
95
- - examples/sample-sinatra-application/config.ru
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: -624327999516463051
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: -624327999516463051
126
+ hash: -4391156441659915844
127
127
  requirements: []
128
128
  rubyforge_project:
129
129
  rubygems_version: 1.8.23