vagrant-down 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/Gemfile +11 -0
- data/LICENSE.txt +22 -0
- data/README.md +28 -0
- data/Rakefile +1 -0
- data/Vagrantfile +12 -0
- data/lib/vagrant-down.rb +1 -0
- data/lib/vagrant-down/plugin.rb +51 -0
- data/lib/vagrant-down/version.rb +5 -0
- data/vagrant-down.gemspec +23 -0
- metadata +82 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 17e54986f57f54424e7c4ca9ba405fe4a2b544a4
|
4
|
+
data.tar.gz: d30f8309495822b8a85e8c9c10588dee3a8e0134
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c59116e087dd1198a41657c82c4a93e4a99ad02974f1b7841db2cdcb0af1a548aa4d18058049affa911d91e97e571f7d84a9fefb2acbd6bfe47550d86c5fbf9c
|
7
|
+
data.tar.gz: 2e45b1ed2f273ffd80b7f8f5a3516835dc8cef21204c05bf311b714f79128009484d8fae122dc2845f36a492f8ba0f125b820567dd0009c197980aef35aae08a
|
data/.gitignore
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
# Specify your gem's dependencies in vagrant-down.gemspec
|
4
|
+
gemspec
|
5
|
+
|
6
|
+
group :development do
|
7
|
+
# We depend on Vagrant for development, but we don't add it as a
|
8
|
+
# gem dependency because we expect to be installed within the
|
9
|
+
# Vagrant environment itself using `vagrant plugin`.
|
10
|
+
gem "vagrant", :git => "git://github.com/mitchellh/vagrant.git", :tag => "v1.3.4"
|
11
|
+
end
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Justin Downing
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# vagrant-down
|
2
|
+
|
3
|
+
Command-line alias for `vagrant destroy`
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Make sure you have Vagrant 1.2+ and run:
|
8
|
+
|
9
|
+
```
|
10
|
+
vagrant plugin install vagrant-down
|
11
|
+
```
|
12
|
+
|
13
|
+
## Usage
|
14
|
+
|
15
|
+
```
|
16
|
+
Usage: vagrant down [vm-name]
|
17
|
+
|
18
|
+
-f, --force Destroy without confirmation.
|
19
|
+
-h, --help Print this help
|
20
|
+
```
|
21
|
+
|
22
|
+
## Examples
|
23
|
+
|
24
|
+
Destroy without confirmation:
|
25
|
+
|
26
|
+
```
|
27
|
+
vagrant down -f
|
28
|
+
```
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/Vagrantfile
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# -*- mode: ruby -*-
|
2
|
+
# vi: set ft=ruby :
|
3
|
+
|
4
|
+
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
|
5
|
+
VAGRANTFILE_API_VERSION = "2"
|
6
|
+
|
7
|
+
# require 'down' plugin for testing
|
8
|
+
Vagrant.require_plugin "vagrant-down"
|
9
|
+
|
10
|
+
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
11
|
+
config.vm.box = "precise64"
|
12
|
+
end
|
data/lib/vagrant-down.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require_relative "vagrant-down/plugin"
|
@@ -0,0 +1,51 @@
|
|
1
|
+
require_relative "version"
|
2
|
+
require "vagrant"
|
3
|
+
|
4
|
+
module VagrantPlugins
|
5
|
+
module Down
|
6
|
+
class Plugin < Vagrant.plugin("2")
|
7
|
+
name "vagrant-down"
|
8
|
+
description <<-DESC
|
9
|
+
This plugin is an alias for the `destroy` command.
|
10
|
+
DESC
|
11
|
+
|
12
|
+
command("down") do
|
13
|
+
Command
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
class Command < Vagrant.plugin(2, :command)
|
18
|
+
def execute
|
19
|
+
options = {
|
20
|
+
force: false
|
21
|
+
}
|
22
|
+
|
23
|
+
opts = OptionParser.new do |o|
|
24
|
+
o.banner = "Usage: vagrant down [vm-name]"
|
25
|
+
o.separator ""
|
26
|
+
|
27
|
+
o.on("-f", "--force", "Destroy without confirmation.") do |f|
|
28
|
+
options[:force] = f
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
# Parse the options
|
33
|
+
argv = parse_options(opts)
|
34
|
+
return if !argv
|
35
|
+
|
36
|
+
@logger.debug("'Destroy' each target VM...")
|
37
|
+
declined = false
|
38
|
+
with_target_vms(argv, :reverse => true) do |vm|
|
39
|
+
action_env = vm.action(
|
40
|
+
:destroy, :force_confirm_destroy => options[:force])
|
41
|
+
|
42
|
+
declined = true if action_env.has_key?(:force_confirm_destroy_result) &&
|
43
|
+
action_env[:force_confirm_destroy_result] == false
|
44
|
+
end
|
45
|
+
|
46
|
+
# Success if no confirms were declined
|
47
|
+
declined ? 1 : 0
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "vagrant-down/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "vagrant-down"
|
8
|
+
spec.version = VagrantPlugins::Down::VERSION
|
9
|
+
spec.authors = ["Justin Downing"]
|
10
|
+
spec.email = ["justin@downing.us"]
|
11
|
+
spec.description = %q{Vagrant destroy alias}
|
12
|
+
spec.summary = spec.description
|
13
|
+
spec.homepage = "https://github.com/justindowning/vagrant-down"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
22
|
+
spec.add_development_dependency "rake"
|
23
|
+
end
|
metadata
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: vagrant-down
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Justin Downing
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-10-09 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.3'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description: Vagrant destroy alias
|
42
|
+
email:
|
43
|
+
- justin@downing.us
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- .gitignore
|
49
|
+
- Gemfile
|
50
|
+
- LICENSE.txt
|
51
|
+
- README.md
|
52
|
+
- Rakefile
|
53
|
+
- Vagrantfile
|
54
|
+
- lib/vagrant-down.rb
|
55
|
+
- lib/vagrant-down/plugin.rb
|
56
|
+
- lib/vagrant-down/version.rb
|
57
|
+
- vagrant-down.gemspec
|
58
|
+
homepage: https://github.com/justindowning/vagrant-down
|
59
|
+
licenses:
|
60
|
+
- MIT
|
61
|
+
metadata: {}
|
62
|
+
post_install_message:
|
63
|
+
rdoc_options: []
|
64
|
+
require_paths:
|
65
|
+
- lib
|
66
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - '>='
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '0'
|
71
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
requirements: []
|
77
|
+
rubyforge_project:
|
78
|
+
rubygems_version: 2.0.6
|
79
|
+
signing_key:
|
80
|
+
specification_version: 4
|
81
|
+
summary: Vagrant destroy alias
|
82
|
+
test_files: []
|