em-systemcommand 2.0.2 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -30,9 +30,11 @@ module EventMachine
30
30
  ##
31
31
  # Returns the command string
32
32
  def to_s
33
- cmd = @arr.shift
33
+ cmd = ''
34
34
  @arr.each do |arg|
35
- if arg.is_a?(Array)
35
+ if arg == @arr.first
36
+ cmd << arg
37
+ elsif arg.is_a?(Array)
36
38
  param = arg.shift
37
39
  param = param.to_s if param.is_a?(Symbol)
38
40
  if param =~ /^\-{1,2}(.*)/
@@ -1,5 +1,5 @@
1
1
  module Em
2
2
  module Systemcommand
3
- VERSION = "2.0.2"
3
+ VERSION = "2.0.3"
4
4
  end
5
5
  end
@@ -53,6 +53,13 @@ describe EM::SystemCommand::Builder do
53
53
  end
54
54
 
55
55
  describe '#to_s' do
56
+ it 'should stay the same' do
57
+ builder = EM::SystemCommand::Builder.new('echo', 'Irgendwas"$')
58
+ builder.to_s.should == "echo 'Irgendwas\"$'"
59
+ builder.to_s.should == "echo 'Irgendwas\"$'"
60
+ builder.to_s.should == "echo 'Irgendwas\"$'"
61
+ end
62
+
56
63
  it 'should escape argument strings' do
57
64
  EM::SystemCommand::Builder.new('echo', 'Irgendwas"$').to_s.
58
65
  should == "echo 'Irgendwas\"$'"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: em-systemcommand
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -163,7 +163,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
163
163
  version: '0'
164
164
  segments:
165
165
  - 0
166
- hash: -2992450543437428239
166
+ hash: 1054973868383458141
167
167
  required_rubygems_version: !ruby/object:Gem::Requirement
168
168
  none: false
169
169
  requirements:
@@ -172,7 +172,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
172
172
  version: '0'
173
173
  segments:
174
174
  - 0
175
- hash: -2992450543437428239
175
+ hash: 1054973868383458141
176
176
  requirements: []
177
177
  rubyforge_project:
178
178
  rubygems_version: 1.8.24