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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 06827d8b27d4b42c6c7f3ba6c2e80c8fc19f97f7
4
- data.tar.gz: 2b9c414164c1844591aaa04e32caa06020d1782a
3
+ metadata.gz: 972e9510ce09b8615fcd3e25e26ae59400da82d9
4
+ data.tar.gz: 0af74dcdfe4ed89d1e9a36eee7850e7bcaaa4a5e
5
5
  SHA512:
6
- metadata.gz: 9bac7be8a9c16f967e4164a074958a08b4016dfd36ea81d6d34b69a7c8138ccba05349b793089d45f09a68c9f4bcb8c57dedf4d03da883a9c3f3bda478ff208e
7
- data.tar.gz: c54d3a48252ccd8f4651f620e4114496c7683e59d8cba15ef1c6d65dd4464c21ea5de2e8ffd7a270a81958313321321ab5daa2a930101fe962efd7eb6f54f24a
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
- # if @cmd.match(/.*\.(sh|ksh|csh)\s*$/i)
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
- # end
30
- @exitStatus = $?.exitstatus
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 + " exist => #{@exitStatus}"
39
+ puts __FILE__ + (__LINE__).to_s + " exitStatus => #{@exitStatus}"
35
40
  end
36
41
 
37
- @exitStatus
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=0
40
+ rc=nil
41
41
  if cmd.is_a?(Hash) && cmd.has_key?(:cmd) && cmd.has_key?(:id)
42
- rc += cmd[:cmd].execute().to_i
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
 
@@ -1,3 +1,3 @@
1
1
  module CmdShellMgr
2
- VERSION = "0.1.1.0.pre"
2
+ VERSION = "0.1.1.1.pre"
3
3
  end
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.0.pre
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-06 00:00:00.000000000 Z
11
+ date: 2016-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler