CmdShellMgr 0.1.1.0.pre → 0.1.1.1.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/CmdShellMgr/Command/command.rb +13 -8
- data/lib/CmdShellMgr/Command/commands.rb +3 -3
- data/lib/CmdShellMgr/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 972e9510ce09b8615fcd3e25e26ae59400da82d9
|
4
|
+
data.tar.gz: 0af74dcdfe4ed89d1e9a36eee7850e7bcaaa4a5e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4f95e0f0b87901406e1d0473313d6ad199094a0087993c1fc350a40a7064c72f4ae7b77a2907fa47bc51df4263382639453878d1d0ef290cbe175e696564f41
|
7
|
+
data.tar.gz: 5e164bc2d91903b2ba51ae4c8220e1d5bac37b00fe927967f5f2ddceb9ad9599dcc6dd48b4416a4d461aaa119104d087caae2aff2967e1977a17744fee6be846
|
@@ -17,24 +17,29 @@ module CmdShellMgr
|
|
17
17
|
@cmd=_c
|
18
18
|
end
|
19
19
|
|
20
|
+
def instance_method
|
21
|
+
self
|
22
|
+
end
|
23
|
+
|
20
24
|
|
21
25
|
def execute(opts=nil)
|
22
26
|
@results=nil
|
27
|
+
@exitStatus=nil
|
23
28
|
|
24
|
-
|
25
|
-
# puts " execute script #{@cmd} #{opts.to_s}" if @debug
|
26
|
-
# @results = %x[ #{@cmd} #{opts.to_s} ]
|
27
|
-
# else
|
29
|
+
begin
|
28
30
|
@results = %x[ #{@cmd} #{opts.to_s} ]
|
29
|
-
|
30
|
-
|
31
|
+
@exitStatus = $?.exitstatus
|
32
|
+
rescue => ex
|
33
|
+
puts __FILE__ + (__LINE__).to_S + " #{ex.class}"
|
34
|
+
puts ex.backtrace
|
35
|
+
end
|
31
36
|
|
32
37
|
if @debug
|
33
38
|
puts __FILE__ + (__LINE__).to_s + " results => #{@results}"
|
34
|
-
puts __FILE__ + (__LINE__).to_s + "
|
39
|
+
puts __FILE__ + (__LINE__).to_s + " exitStatus => #{@exitStatus}"
|
35
40
|
end
|
36
41
|
|
37
|
-
|
42
|
+
return self
|
38
43
|
end
|
39
44
|
|
40
45
|
def exitStatus
|
@@ -37,9 +37,9 @@ module CmdShellMgr
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def _execute(cmd)
|
40
|
-
rc=
|
40
|
+
rc=nil
|
41
41
|
if cmd.is_a?(Hash) && cmd.has_key?(:cmd) && cmd.has_key?(:id)
|
42
|
-
rc
|
42
|
+
rc = cmd[:cmd].execute()
|
43
43
|
end
|
44
44
|
|
45
45
|
rc
|
@@ -62,7 +62,7 @@ module CmdShellMgr
|
|
62
62
|
hits = @queue.select { |cmd| cmd[:id]==id }
|
63
63
|
hits.each do |h|
|
64
64
|
puts __FILE__ + (__LINE__).to_s + " #{h}" if @debug
|
65
|
-
_execute(h)
|
65
|
+
rc=_execute(h)
|
66
66
|
end
|
67
67
|
end
|
68
68
|
|
data/lib/CmdShellMgr/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: CmdShellMgr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.1.
|
4
|
+
version: 0.1.1.1.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kim, Peter
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|