runnable 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.2
data/lib/runnable/gnu.rb CHANGED
@@ -31,14 +31,17 @@ class Gnu < CommandParser
31
31
  # We assume that an one character words is preceed by one
32
32
  # lead and two or more characters words are preceed by two
33
33
  # leads
34
- result << ( param.length == 1 ? "-#{param} " : "--#{param} " )
34
+ result.concat( param.length == 1 ? "-#{param}" : "--#{param}" )
35
35
 
36
36
  # In case the param have parameter we use the correct assignation
37
37
  # -Param followed by value (without whitespace) to one character params
38
38
  # -Param followed by '=' and value to more than one character params
39
39
  if( value != nil )
40
- result << ( param.length == 1 ? "#{value}" : "=#{value}" )
40
+ result.concat( param.length == 1 ? "#{value}" : "=#{value}" )
41
41
  end
42
+
43
+ # Final whitespace
44
+ result.concat( " " )
42
45
  end
43
46
 
44
47
  return result.strip
data/lib/runnable.rb CHANGED
@@ -129,11 +129,18 @@ class Runnable
129
129
  out_rd, out_wr = IO.pipe
130
130
  # Redirect Error I/O
131
131
  err_rd, err_wr = IO.pipe
132
-
133
- @pid = Process.spawn( "#{@command} #{@input.join( " " )} \
134
- #{@options} #{@command_line_interface.parse} \
135
- #{@output.join( " " )}", { :out => out_wr, :err => err_wr } )
136
-
132
+
133
+ # Set up the command line
134
+ command = []
135
+ command << @command
136
+ command << @input.join( " " )
137
+ command << @options
138
+ command << @command_line_interface.parse
139
+ command << @output.join( " " )
140
+ command = command.join( " " )
141
+
142
+ @pid = Process.spawn( command, { :out => out_wr, :err => err_wr } )
143
+
137
144
  # Include instance in class variable
138
145
  @@processes[@pid] = self
139
146
 
@@ -429,9 +436,11 @@ class Runnable
429
436
  # @return [nil]
430
437
  def parse_hash( hash )
431
438
  hash.each do |key, value|
432
- # Call to a undefined method which trigger overwritten method_missing
433
- # unless its named as a runnable method
434
- self.public_send( key.to_sym, value ) unless self.respond_to?( key.to_sym )
439
+ # Add the param parsed to command_line_interface
440
+ @command_line_interface.add_param(
441
+ key.to_s,
442
+ value != nil ? value.to_s : nil
443
+ )
435
444
  end
436
445
  end
437
446
  end
data/runnable.gemspec CHANGED
@@ -5,13 +5,13 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{runnable}
8
- s.version = "0.2.1"
8
+ s.version = "0.2.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Rafael García", "Luis Ciudad", "Pedro Navajas", "Javier Aranda"]
12
- s.date = %q{2011-08-08}
11
+ s.authors = [%q{Rafael García}, %q{Luis Ciudad}, %q{Pedro Navajas}, %q{Javier Aranda}]
12
+ s.date = %q{2011-08-11}
13
13
  s.description = %q{Convert a executable command in a Ruby-like class you are able to start, define params and send signals (like kill, or stop)}
14
- s.email = ["rgarcia@nosolosoftware.biz", "lciudad@nosolosoftware.biz", "pnavajas@nosolosoftware.biz", "jaranda@nosolosoftware.biz"]
14
+ s.email = [%q{rgarcia@nosolosoftware.biz}, %q{lciudad@nosolosoftware.biz}, %q{pnavajas@nosolosoftware.biz}, %q{jaranda@nosolosoftware.biz}]
15
15
  s.extra_rdoc_files = [
16
16
  "README.markdown"
17
17
  ]
@@ -26,9 +26,9 @@ Gem::Specification.new do |s|
26
26
  "runnable.gemspec"
27
27
  ]
28
28
  s.homepage = %q{http://github.com/nosolosoftware/runnable}
29
- s.licenses = ["GPL-3"]
30
- s.require_paths = ["lib"]
31
- s.rubygems_version = %q{1.6.2}
29
+ s.licenses = [%q{GPL-3}]
30
+ s.require_paths = [%q{lib}]
31
+ s.rubygems_version = %q{1.8.6}
32
32
  s.summary = %q{A Ruby gem for execute and control system commands}
33
33
 
34
34
  if s.respond_to? :specification_version then
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runnable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -12,12 +12,11 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2011-08-08 00:00:00.000000000 +02:00
16
- default_executable:
15
+ date: 2011-08-11 00:00:00.000000000Z
17
16
  dependencies:
18
17
  - !ruby/object:Gem::Dependency
19
18
  name: rake
20
- requirement: &20613220 !ruby/object:Gem::Requirement
19
+ requirement: &75050040 !ruby/object:Gem::Requirement
21
20
  none: false
22
21
  requirements:
23
22
  - - ! '>='
@@ -25,10 +24,10 @@ dependencies:
25
24
  version: 0.8.7
26
25
  type: :development
27
26
  prerelease: false
28
- version_requirements: *20613220
27
+ version_requirements: *75050040
29
28
  - !ruby/object:Gem::Dependency
30
29
  name: yard
31
- requirement: &20606980 !ruby/object:Gem::Requirement
30
+ requirement: &75049640 !ruby/object:Gem::Requirement
32
31
  none: false
33
32
  requirements:
34
33
  - - ! '>='
@@ -36,10 +35,10 @@ dependencies:
36
35
  version: 0.6.8
37
36
  type: :development
38
37
  prerelease: false
39
- version_requirements: *20606980
38
+ version_requirements: *75049640
40
39
  - !ruby/object:Gem::Dependency
41
40
  name: rspec
42
- requirement: &20605980 !ruby/object:Gem::Requirement
41
+ requirement: &75049120 !ruby/object:Gem::Requirement
43
42
  none: false
44
43
  requirements:
45
44
  - - ! '>='
@@ -47,10 +46,10 @@ dependencies:
47
46
  version: 2.5.0
48
47
  type: :development
49
48
  prerelease: false
50
- version_requirements: *20605980
49
+ version_requirements: *75049120
51
50
  - !ruby/object:Gem::Dependency
52
51
  name: cucumber
53
- requirement: &20604860 !ruby/object:Gem::Requirement
52
+ requirement: &75048540 !ruby/object:Gem::Requirement
54
53
  none: false
55
54
  requirements:
56
55
  - - ! '>='
@@ -58,10 +57,10 @@ dependencies:
58
57
  version: 0.10.2
59
58
  type: :development
60
59
  prerelease: false
61
- version_requirements: *20604860
60
+ version_requirements: *75048540
62
61
  - !ruby/object:Gem::Dependency
63
62
  name: jeweler
64
- requirement: &20603560 !ruby/object:Gem::Requirement
63
+ requirement: &75048080 !ruby/object:Gem::Requirement
65
64
  none: false
66
65
  requirements:
67
66
  - - ! '>='
@@ -69,10 +68,10 @@ dependencies:
69
68
  version: 1.6.0
70
69
  type: :development
71
70
  prerelease: false
72
- version_requirements: *20603560
71
+ version_requirements: *75048080
73
72
  - !ruby/object:Gem::Dependency
74
73
  name: bluecloth
75
- requirement: &20602440 !ruby/object:Gem::Requirement
74
+ requirement: &75047650 !ruby/object:Gem::Requirement
76
75
  none: false
77
76
  requirements:
78
77
  - - ! '>='
@@ -80,7 +79,7 @@ dependencies:
80
79
  version: 2.1.0
81
80
  type: :development
82
81
  prerelease: false
83
- version_requirements: *20602440
82
+ version_requirements: *75047650
84
83
  description: Convert a executable command in a Ruby-like class you are able to start,
85
84
  define params and send signals (like kill, or stop)
86
85
  email:
@@ -101,7 +100,6 @@ files:
101
100
  - lib/runnable/extended.rb
102
101
  - lib/runnable/gnu.rb
103
102
  - runnable.gemspec
104
- has_rdoc: true
105
103
  homepage: http://github.com/nosolosoftware/runnable
106
104
  licenses:
107
105
  - GPL-3
@@ -117,7 +115,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
117
115
  version: '0'
118
116
  segments:
119
117
  - 0
120
- hash: 3781212566389578012
118
+ hash: 86695023
121
119
  required_rubygems_version: !ruby/object:Gem::Requirement
122
120
  none: false
123
121
  requirements:
@@ -126,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
126
124
  version: '0'
127
125
  requirements: []
128
126
  rubyforge_project:
129
- rubygems_version: 1.6.2
127
+ rubygems_version: 1.8.6
130
128
  signing_key:
131
129
  specification_version: 3
132
130
  summary: A Ruby gem for execute and control system commands