mescal-cli 0.2.2 → 0.2.3

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: 2375c155495f707a52ae7424d6974130f44cb652
4
- data.tar.gz: 3aeadbb68e08855648caa0fcd29b780b08b7e6a0
3
+ metadata.gz: aa001795f7ca4a25b4608f8a6849687c43bfdc10
4
+ data.tar.gz: f780fe6e43cc5a763e9f78c38a3ddbb5e1d77b3d
5
5
  SHA512:
6
- metadata.gz: c6c7cd768d2f34e8eeb641dc69782f1e94ba8b55ddbebb6d032aed2a359388a98b34c36138ad35acd2944d8d6e19eb99ba614e8253ba40eaa3f6c2dfc41fd63e
7
- data.tar.gz: e1f3a718cb29dd02515776822185c9314b32683b4ede5aa99169dcc078031c4a2cd8efe3f937d731ce42956961b47ff48754f13f9636d714ab805a2a193eb526
6
+ metadata.gz: b9b9114960192527fb812e93bea65b86d15b298b940a99dddaf9af24c937e7e850c854b9330cd7369e308783455d074efe97b2acb016fa400fa9c25f2b46a461
7
+ data.tar.gz: 7ca21fe3a2155a7065dc61e3ab418200a09fc90808947fcdcfc35200e3333f3ad0ea14554cdd70d04440ab4821221c524f82957e7f764b4653389e16c41b05b3
@@ -23,7 +23,7 @@ module MescalCli
23
23
  when "run" then run
24
24
  when "ssh" then ssh
25
25
  when "list" then list
26
- when "kill" then kill
26
+ when "kill" then kill(ARGV[1])
27
27
  end
28
28
  end
29
29
 
@@ -55,7 +55,10 @@ module MescalCli
55
55
  run = !task.done?
56
56
  end
57
57
  sleep(10)
58
- threads.each { |t| t.kill }
58
+ rescue Interrupt
59
+ kill(task.id) if !!task
60
+ ensure
61
+ threads.each { |t| t.kill } if !!threads
59
62
  end
60
63
 
61
64
  def ssh
@@ -78,12 +81,11 @@ module MescalCli
78
81
  end
79
82
  end
80
83
 
81
- def kill
82
- @id = ARGV[1]
83
- if(killed = Task.kill(@client, @id))
84
+ def kill(id)
85
+ if(killed = Task.kill(@client, id))
84
86
  puts "Killed #{killed}"
85
87
  else
86
- puts "Failed to kill #{@id}"
88
+ puts "Failed to kill #{id}"
87
89
  end
88
90
  end
89
91
 
@@ -1,3 +1,3 @@
1
1
  module MescalCli
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mescal-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Kite
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-14 00:00:00.000000000 Z
11
+ date: 2015-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler