command-builder 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -8,5 +8,5 @@ source "http://rubygems.org"
8
8
  # Include everything needed to run rake, tests, features, etc.
9
9
  group :development do
10
10
  gem "bundler", ">= 1.0.0"
11
- gem "jeweler", ">= 1.5.2"
11
+ gem "jeweler2"
12
12
  end
@@ -2,14 +2,11 @@ GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
4
  git (1.2.5)
5
- hash-utils (0.19.0)
5
+ hash-utils (1.1.0)
6
6
  ruby-version
7
- jeweler (1.6.4)
8
- bundler (~> 1.0)
7
+ jeweler2 (2.0.9)
9
8
  git (>= 1.2.5)
10
- rake
11
- pipe-run (0.2.1)
12
- rake (0.9.2)
9
+ pipe-run (0.3.0)
13
10
  ruby-version (0.3.1)
14
11
 
15
12
  PLATFORMS
@@ -18,5 +15,5 @@ PLATFORMS
18
15
  DEPENDENCIES
19
16
  bundler (>= 1.0.0)
20
17
  hash-utils (>= 0.18.0)
21
- jeweler (>= 1.5.2)
18
+ jeweler2
22
19
  pipe-run (>= 0.2.1)
data/Rakefile CHANGED
@@ -11,7 +11,7 @@ rescue Bundler::BundlerError => e
11
11
  end
12
12
 
13
13
  require 'rake'
14
- require 'jeweler'
14
+ require 'jeweler2'
15
15
 
16
16
  Jeweler::Tasks.new do |gem|
17
17
  # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.2
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "command-builder"
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
11
  s.authors = ["Martin Koz\u{e1}k"]
12
- s.date = "2011-10-18"
12
+ s.date = "2011-12-13"
13
13
  s.email = "martinkozak@martinkozak.net"
14
14
  s.extra_rdoc_files = [
15
15
  "LICENSE.txt",
@@ -31,7 +31,7 @@ Gem::Specification.new do |s|
31
31
  s.homepage = "https://github.com/martinkozak/command-builder"
32
32
  s.licenses = ["MIT"]
33
33
  s.require_paths = ["lib"]
34
- s.rubygems_version = "1.8.11"
34
+ s.rubygems_version = "1.8.12"
35
35
  s.summary = "Builds command runnable from shell by simple and ellegant way. Also allows both synchronous executing or asynchronous one using EventMachine."
36
36
 
37
37
  if s.respond_to? :specification_version then
@@ -41,18 +41,18 @@ Gem::Specification.new do |s|
41
41
  s.add_runtime_dependency(%q<hash-utils>, [">= 0.18.0"])
42
42
  s.add_runtime_dependency(%q<pipe-run>, [">= 0.2.1"])
43
43
  s.add_development_dependency(%q<bundler>, [">= 1.0.0"])
44
- s.add_development_dependency(%q<jeweler>, [">= 1.5.2"])
44
+ s.add_development_dependency(%q<jeweler2>, [">= 0"])
45
45
  else
46
46
  s.add_dependency(%q<hash-utils>, [">= 0.18.0"])
47
47
  s.add_dependency(%q<pipe-run>, [">= 0.2.1"])
48
48
  s.add_dependency(%q<bundler>, [">= 1.0.0"])
49
- s.add_dependency(%q<jeweler>, [">= 1.5.2"])
49
+ s.add_dependency(%q<jeweler2>, [">= 0"])
50
50
  end
51
51
  else
52
52
  s.add_dependency(%q<hash-utils>, [">= 0.18.0"])
53
53
  s.add_dependency(%q<pipe-run>, [">= 0.2.1"])
54
54
  s.add_dependency(%q<bundler>, [">= 1.0.0"])
55
- s.add_dependency(%q<jeweler>, [">= 1.5.2"])
55
+ s.add_dependency(%q<jeweler2>, [">= 0"])
56
56
  end
57
57
  end
58
58
 
@@ -3,6 +3,7 @@
3
3
 
4
4
  require "hash-utils/object"
5
5
  require "hash-utils/array"
6
+ require "shellwords"
6
7
  require "pipe-run"
7
8
 
8
9
  ##
@@ -201,27 +202,7 @@ class CommandBuilder
201
202
 
202
203
  def quote(value)
203
204
  value = value.to_s
204
-
205
- # Looks for " and '
206
- single = value["'"].to_b
207
- double = value['"'].to_b
208
-
209
- # According to found characters selects quotation
210
- if single and value
211
- value = value.gsub('"', '\\"')
212
- quotation = '"'
213
- elsif single
214
- quotation = '"'
215
- elsif double
216
- quotation = "'"
217
- elsif value[" "]
218
- quotation = '"'
219
- else
220
- quotation = ""
221
- end
222
-
223
- # Returns
224
- return quotation + value + quotation
205
+ Shellwords::escape(value)
225
206
  end
226
207
 
227
208
  ##
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: command-builder
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:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-10-18 00:00:00.000000000 Z
12
+ date: 2011-12-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: hash-utils
16
- requirement: &24378480 !ruby/object:Gem::Requirement
16
+ requirement: &8465080 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.18.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *24378480
24
+ version_requirements: *8465080
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: pipe-run
27
- requirement: &24377300 !ruby/object:Gem::Requirement
27
+ requirement: &8463340 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 0.2.1
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *24377300
35
+ version_requirements: *8463340
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: bundler
38
- requirement: &24351440 !ruby/object:Gem::Requirement
38
+ requirement: &8462660 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,18 +43,18 @@ dependencies:
43
43
  version: 1.0.0
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *24351440
46
+ version_requirements: *8462660
47
47
  - !ruby/object:Gem::Dependency
48
- name: jeweler
49
- requirement: &24350620 !ruby/object:Gem::Requirement
48
+ name: jeweler2
49
+ requirement: &8461920 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
53
53
  - !ruby/object:Gem::Version
54
- version: 1.5.2
54
+ version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *24350620
57
+ version_requirements: *8461920
58
58
  description:
59
59
  email: martinkozak@martinkozak.net
60
60
  executables: []
@@ -89,7 +89,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
89
89
  version: '0'
90
90
  segments:
91
91
  - 0
92
- hash: 2847174649961894634
92
+ hash: 4070120530091503344
93
93
  required_rubygems_version: !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
@@ -98,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
98
98
  version: '0'
99
99
  requirements: []
100
100
  rubyforge_project:
101
- rubygems_version: 1.8.11
101
+ rubygems_version: 1.8.12
102
102
  signing_key:
103
103
  specification_version: 3
104
104
  summary: Builds command runnable from shell by simple and ellegant way. Also allows