rexec 1.2.3 → 1.2.4

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.
@@ -0,0 +1,18 @@
1
+
2
+ class Array
3
+ # Join a sequence of arguments together to form a executable command.
4
+ def to_cmd
5
+ collect{|v| v.to_cmd}.join(' ')
6
+ end
7
+ end
8
+
9
+ class String
10
+ # Conditionally quote a string if it contains whitespace or quotes.
11
+ def to_cmd
12
+ if match(/\s|"|'/)
13
+ self.dump
14
+ else
15
+ self
16
+ end
17
+ end
18
+ end
data/lib/rexec/version.rb CHANGED
@@ -22,7 +22,7 @@ module RExec
22
22
  module VERSION
23
23
  MAJOR = 1
24
24
  MINOR = 2
25
- TINY = 3
25
+ TINY = 4
26
26
 
27
27
  STRING = [MAJOR, MINOR, TINY].join('.')
28
28
  end
data/lib/rexec.rb CHANGED
@@ -22,8 +22,9 @@ require 'rexec/version'
22
22
  require 'rexec/connection'
23
23
  require 'rexec/server'
24
24
  require 'rexec/priviledges'
25
+ require 'rexec/to_cmd'
25
26
 
26
- ## RExec is a tool to assist with the execution of other processes.
27
+ # RExec is a tool to assist with the execution of other processes.
27
28
  module RExec
28
29
 
29
30
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 2
8
- - 3
9
- version: 1.2.3
8
+ - 4
9
+ version: 1.2.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Samuel Williams
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-07-13 00:00:00 +12:00
17
+ date: 2011-07-14 00:00:00 +12:00
18
18
  default_executable: daemon-exec
19
19
  dependencies: []
20
20
 
@@ -39,6 +39,7 @@ files:
39
39
  - lib/rexec/reverse_io.rb
40
40
  - lib/rexec/server.rb
41
41
  - lib/rexec/task.rb
42
+ - lib/rexec/to_cmd.rb
42
43
  - lib/rexec/version.rb
43
44
  - lib/rexec.rb
44
45
  - test/client.rb