vagrant-down 0.0.2 → 0.0.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: 15495beefb21705866a56c0d8d5a4e32fc9ad4d7
4
- data.tar.gz: 40eec2675b29a01065695061a0f202691306ae20
3
+ metadata.gz: 82ad4e6dee729e6e4a066bb70002c2a3d69832d4
4
+ data.tar.gz: 5084a913f462849510cec8f78f680fdd35bf10d7
5
5
  SHA512:
6
- metadata.gz: 4a4a633bd484e7fef1765e8f6f1772f1407cfd3ca1e9cd8f4122f663d2704921ef60f476d0fe8133bc93163ab404eeedda56631920c72e4972b69fbfe693a5d7
7
- data.tar.gz: 7f13114f7959cd0a5b0ba529b9c504d20d9c56982d7062a16bf8801e28487873a1560ec32007e80023df047fbc3bc553d4017b91637d7f49cfa7ba8e98f639a0
6
+ metadata.gz: 0a52de8d297f3b966771aea684df0595e691264f1861c3fd9abb49594b96bb0681b5666076ae5271bf608d293348de744b97d8abda4859bb4dea7a4a86e7c828
7
+ data.tar.gz: 744119f2afc3bbfe4989ae6e729f1f463bca19ebf65fd72f4d8bd786c6ce107fad8dcd3f47e34314f5711e17c2b05d4b1e3ddd220d9984cb61c22fd267a84001
@@ -14,19 +14,19 @@ module VagrantPlugins
14
14
 
15
15
  end
16
16
 
17
- class Command < Vagrant.plugin(2, :command)
18
-
17
+ class Command < Vagrant.plugin("2", :command)
19
18
  def self.synopsis
20
19
  'alias for destroy command'
21
20
  end
22
21
 
23
22
  def execute
24
- options = {
25
- force: false
26
- }
23
+ options = {}
24
+ options[:force] = false
27
25
 
28
26
  opts = OptionParser.new do |o|
29
- o.banner = "Usage: vagrant down [vm-name]"
27
+ o.banner = "Usage: vagrant down [options] [name]"
28
+ o.separator ""
29
+ o.separator "Options:"
30
30
  o.separator ""
31
31
 
32
32
  o.on("-f", "--force", "Destroy without confirmation.") do |f|
@@ -39,17 +39,25 @@ module VagrantPlugins
39
39
  return if !argv
40
40
 
41
41
  @logger.debug("'Destroy' each target VM...")
42
- declined = false
42
+ declined = 0
43
+ total = 0
43
44
  with_target_vms(argv, :reverse => true) do |vm|
44
45
  action_env = vm.action(
45
46
  :destroy, :force_confirm_destroy => options[:force])
46
47
 
47
- declined = true if action_env.has_key?(:force_confirm_destroy_result) &&
48
+ total += 1
49
+ declined += 1 if action_env.has_key?(:force_confirm_destroy_result) &&
48
50
  action_env[:force_confirm_destroy_result] == false
49
51
  end
50
52
 
51
- # Success if no confirms were declined
52
- declined ? 1 : 0
53
+ # Nothing was declined
54
+ return 0 if declined == 0
55
+
56
+ # Everything was declined
57
+ return 1 if declined == total
58
+
59
+ # Some was declined
60
+ return 2
53
61
  end
54
62
  end
55
63
  end
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module Down
3
- VERSION = '0.0.2'
3
+ VERSION = '0.0.3'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-down
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Downing
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-01 00:00:00.000000000 Z
11
+ date: 2014-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler