rush 0.6.5 → 0.6.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/lib/rush/box.rb +2 -1
  3. data/spec/box_spec.rb +4 -0
  4. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.5
1
+ 0.6.6
@@ -82,7 +82,8 @@ class Rush::Box
82
82
  return command unless env
83
83
 
84
84
  vars = env.map do |key, value|
85
- "export #{key}=\"#{value.to_s.gsub('"', '\\"')}\""
85
+ escaped = value.to_s.gsub('"', '\\"').gsub('`', '\\\`')
86
+ "export #{key}=\"#{escaped}\""
86
87
  end
87
88
  vars.push(command).join("\n")
88
89
  end
@@ -45,6 +45,10 @@ describe Rush::Box do
45
45
  @box.command_with_environment('cmd', { :a => 'a"b' }).should == "export a=\"a\\\"b\"\ncmd"
46
46
  end
47
47
 
48
+ it "escapes backticks on environment variables" do
49
+ @box.command_with_environment('cmd', { :a => 'a`b' }).should == "export a=\"a\\\`b\"\ncmd"
50
+ end
51
+
48
52
  it "converts environment variables to_s" do
49
53
  @box.command_with_environment('cmd', { :a => nil, :b => 123 }).should == "export a=\"\"\nexport b=\"123\"\ncmd"
50
54
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rush
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.5
4
+ version: 0.6.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Wiggins
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-01-20 00:00:00 -08:00
12
+ date: 2010-01-29 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency