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 +4 -4
- data/lib/vagrant-down/plugin.rb +18 -10
- data/lib/vagrant-down/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: 82ad4e6dee729e6e4a066bb70002c2a3d69832d4
|
4
|
+
data.tar.gz: 5084a913f462849510cec8f78f680fdd35bf10d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a52de8d297f3b966771aea684df0595e691264f1861c3fd9abb49594b96bb0681b5666076ae5271bf608d293348de744b97d8abda4859bb4dea7a4a86e7c828
|
7
|
+
data.tar.gz: 744119f2afc3bbfe4989ae6e729f1f463bca19ebf65fd72f4d8bd786c6ce107fad8dcd3f47e34314f5711e17c2b05d4b1e3ddd220d9984cb61c22fd267a84001
|
data/lib/vagrant-down/plugin.rb
CHANGED
@@ -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
|
-
|
26
|
-
}
|
23
|
+
options = {}
|
24
|
+
options[:force] = false
|
27
25
|
|
28
26
|
opts = OptionParser.new do |o|
|
29
|
-
o.banner = "Usage: vagrant down [
|
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 =
|
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
|
-
|
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
|
-
#
|
52
|
-
|
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
|
data/lib/vagrant-down/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2014-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|