figaro 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- data/figaro.gemspec +1 -1
- data/lib/figaro.rb +4 -1
- data/spec/figaro_spec.rb +6 -0
- metadata +3 -3
data/figaro.gemspec
CHANGED
data/lib/figaro.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require "shellwords"
|
1
2
|
require "figaro/env"
|
2
3
|
require "figaro/railtie"
|
3
4
|
require "figaro/tasks"
|
@@ -6,7 +7,9 @@ module Figaro
|
|
6
7
|
extend self
|
7
8
|
|
8
9
|
def vars(custom_environment = nil)
|
9
|
-
env(custom_environment).map{|
|
10
|
+
env(custom_environment).map { |key, value|
|
11
|
+
"#{key}=#{Shellwords.escape(value)}"
|
12
|
+
}.sort.join(" ")
|
10
13
|
end
|
11
14
|
|
12
15
|
def env(custom_environment = nil)
|
data/spec/figaro_spec.rb
CHANGED
@@ -17,6 +17,12 @@ describe Figaro do
|
|
17
17
|
Figaro.vars("development").should == "HELLO=developers"
|
18
18
|
Figaro.vars("production").should == "HELLO=world"
|
19
19
|
end
|
20
|
+
|
21
|
+
it "escapes special characters" do
|
22
|
+
Figaro.stub(:env => Figaro::Env.from("FOO" => "bar baz"))
|
23
|
+
|
24
|
+
Figaro.vars.should == 'FOO=bar\ baz'
|
25
|
+
end
|
20
26
|
end
|
21
27
|
|
22
28
|
describe ".env" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: figaro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -158,7 +158,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
158
158
|
version: '0'
|
159
159
|
segments:
|
160
160
|
- 0
|
161
|
-
hash: -
|
161
|
+
hash: -3783607123632594694
|
162
162
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
163
163
|
none: false
|
164
164
|
requirements:
|
@@ -167,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
167
167
|
version: '0'
|
168
168
|
segments:
|
169
169
|
- 0
|
170
|
-
hash: -
|
170
|
+
hash: -3783607123632594694
|
171
171
|
requirements: []
|
172
172
|
rubyforge_project:
|
173
173
|
rubygems_version: 1.8.24
|