yaml-exec 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/yaml/exec.rb +7 -4
- data/lib/yaml/exec/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81067e6fc5de2d5864b468f5b286733acf632402
|
4
|
+
data.tar.gz: 43abf329816987625660db3c6af588a33502b502
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5538cc3e98f13f8058809b81bc82b9bb89f8a076261c860230b23596835b9e3a4b8811ea56127bf45ee932ca8f493c8520cc9560919465652573eb2232baa930
|
7
|
+
data.tar.gz: 0a6e4e52f5589286634f6428f30e9592d4c31647f50bd49c50fb7f9cfd709d574fc588ca78c47938b3ddf76e8c0324b05ac2a4651587d5bc77bb9f166ce1a18d
|
data/lib/yaml/exec.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require "yaml/exec/version"
|
2
2
|
require 'yaml'
|
3
|
+
require 'shellwords'
|
3
4
|
|
4
5
|
module Yaml
|
5
6
|
module Exec
|
@@ -21,9 +22,9 @@ module Yaml
|
|
21
22
|
out = @cmd.dup
|
22
23
|
hash.each do |value, args|
|
23
24
|
cmd_args args, out
|
24
|
-
out.concat " #{value}"
|
25
|
+
out.concat " #{_ value}"
|
25
26
|
end
|
26
|
-
|
27
|
+
spawn out
|
27
28
|
end
|
28
29
|
|
29
30
|
def cmd_args(args, out)
|
@@ -31,16 +32,18 @@ module Yaml
|
|
31
32
|
case v
|
32
33
|
when Hash; cmd_arg_hash(k, v, out)
|
33
34
|
when Array
|
34
|
-
else out.concat " --#{k} #{v}"
|
35
|
+
else out.concat " --#{_ k} #{_ v}"
|
35
36
|
end
|
36
37
|
end
|
37
38
|
end
|
38
39
|
|
39
40
|
def cmd_arg_hash(key, hash, out)
|
40
41
|
hash.each do |k,v|
|
41
|
-
out.concat " --#{key} #{k}=#{v}"
|
42
|
+
out.concat " --#{_ key} #{_ k}=#{_ v}"
|
42
43
|
end
|
43
44
|
end
|
45
|
+
|
46
|
+
def _(text) Shellwords.escape text end
|
44
47
|
end
|
45
48
|
end
|
46
49
|
end
|
data/lib/yaml/exec/version.rb
CHANGED