figaro 0.5.1 → 0.5.2

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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |gem|
4
4
  gem.name = "figaro"
5
- gem.version = "0.5.1"
5
+ gem.version = "0.5.2"
6
6
 
7
7
  gem.authors = ["Steve Richert"]
8
8
  gem.email = ["steve.richert@gmail.com"]
@@ -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{|k,v| "#{k}=#{v}" }.sort.join(" ")
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)
@@ -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.1
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: -996973026754623645
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: -996973026754623645
170
+ hash: -3783607123632594694
171
171
  requirements: []
172
172
  rubyforge_project:
173
173
  rubygems_version: 1.8.24