vagrant-nuke 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ OTU2NGRjM2VhMDU3NjRlYzhiMGQ5ZjAxNDg5NDhiZDU4ZDVkY2FhOQ==
5
+ data.tar.gz: !binary |-
6
+ MmU1MWU3M2UzOWYyNWRiMzUzMDJkNTAzMmJlNThkODdmOTdmMGM3Nw==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ ODBmN2FkNDg2ZTc3NzBiODA0MzkxNTZlYTUzMDljY2Y5NDJhNzhjYTJmODgw
10
+ NGE1MTAzODEwZTE0YTUzNTZjZmU3YmZjZGRkM2MxMzYyMTRmY2U2NGMzYzFi
11
+ ODQ3NTYyMDg2NjNlYTE5YzU2MmE0YjM5Y2FmZGJmNjg2ZGY4MzE=
12
+ data.tar.gz: !binary |-
13
+ NDhjMDlhNzU3ZGJmOGJmYTFmODU3YzVmNjVlODE0OGEyYzIzMGEzNmNkZTE2
14
+ ZGQxY2JiZGNiNzNhN2YxMjNiMDU1ODVmNDczZTJkMDIzMDM5Y2Q2MDQwOTgz
15
+ ZjYzZmJmZDY5MjA2YWI5ODkyNjBiYWVkYzhlYmE2M2MxNjMwMDM=
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/.travis.yml ADDED
@@ -0,0 +1,11 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ deploy:
5
+ provider: rubygems
6
+ api_key:
7
+ secure: GTH+rO2iodGGkNBth4yGyJ3XUxibVCE9MLqC+kB1aL+H35QGXZjGw8QFNCW2AMoYhsnjn6e1noP+hd6sm0qkU0a2JouArzqvr2+XLxmL2z1B/gt+WpUQJyYzYS94CJx6nQGpaJZKj+vLTN3pL/M3qLUvM8WsmqAcziO5BJBobzc=
8
+ gem: vagrant-nuke
9
+ on:
10
+ tags: true
11
+ repo: n00bworks/vagrant-nuke
data/Gemfile ADDED
@@ -0,0 +1,13 @@
1
+ source 'https://rubygems.org'
2
+
3
+ group :development do
4
+ gem "vagrant", git: "https://github.com/mitchellh/vagrant.git"
5
+ end
6
+
7
+ group :plugins do
8
+ gem "vagrant-nuke", path: "."
9
+ end
10
+
11
+ group :test do
12
+ gem 'rake'
13
+ end
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 n00bworks LLC
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,30 @@
1
+ vagrant-nuke
2
+ ========
3
+ [![Build Status](https://travis-ci.org/n00bworks/vagrant-nuke.svg)](https://travis-ci.org/n00bworks/vagrant-nuke)
4
+
5
+ Vagrant plugin to remove all boxes listed under vagrant box list
6
+
7
+ ### Installation
8
+
9
+ gem coming soon
10
+
11
+ ### Usage
12
+
13
+ #### Basic Usage
14
+
15
+ vagrant nuke
16
+
17
+ #### Options
18
+
19
+ This is nothing more than a list of boxes that would have been destroyed, same as vagrant box list
20
+
21
+ vagrant nuke -w
22
+ vagrant nuke --whatif
23
+
24
+ ##Contributing
25
+
26
+ 1. Fork it
27
+ 2. Create your feature branch (git checkout -b my-new-feature)
28
+ 3. Commit your changes (git commit -am 'Add some feature')
29
+ 4. Push to the branch (git push origin my-new-feature)
30
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,5 @@
1
+ require 'rubygems'
2
+ require 'bundler/setup'
3
+ Bundler::GemHelper.install_tasks
4
+
5
+ task :default => [:build]
@@ -0,0 +1,50 @@
1
+ module Vagrant
2
+ module Nuke
3
+ class Command < Vagrant.plugin('2', :command)
4
+ def execute
5
+ options = {}
6
+ opts = OptionParser.new do |o|
7
+ o.banner = 'Usage: vagrant nuke [options]'
8
+ o.separator ""
9
+ o.separator "Options:"
10
+ o.separator ""
11
+ o.on("-w","--whatif", "Displays all boxes that will be removed") do |i|
12
+ options[:whatif] = i
13
+ end
14
+ end
15
+
16
+ args = parse_options(opts)
17
+ return if !args
18
+
19
+ boxes = @env.boxes.all.sort
20
+ if boxes.empty?
21
+ return @env.ui.warn("no boxes found")
22
+ end
23
+
24
+ nuke_boxes(boxes, options[:whatif])
25
+ #exit as 0 great success!
26
+ 0
27
+ end
28
+
29
+ def nuke_boxes(boxes, whatif)
30
+ if whatif
31
+ @env.ui.info("These would have been nuked")
32
+ boxes.each do |name, version, provider|
33
+ @env.ui.info("#{name}")
34
+ @env.ui.machine("box-name", name)
35
+ end
36
+ elsif
37
+ boxes.each do |name, version, provider|
38
+ @env.ui.info("#{name}")
39
+ @env.ui.machine("box-name", name)
40
+ @env.action_runner.run(Vagrant::Action.action_box_remove, {
41
+ box_name: name,
42
+ force_confirm_box_remove: true,
43
+ })
44
+ end
45
+ end
46
+ end
47
+
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,17 @@
1
+ module Vagrant
2
+ module Nuke
3
+ class Plugin < Vagrant.plugin('2')
4
+ name "nuke"
5
+ description <<-DESC
6
+ The `nuke` command deletes all existing Vagrant boxes currently stored
7
+ as seen in vagrant box list.
8
+ DESC
9
+
10
+ command 'nuke' do
11
+ require_relative 'command'
12
+ Command
13
+ end
14
+
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,5 @@
1
+ module Vagrant
2
+ module Nuke
3
+ VERSION = '0.0.2'
4
+ end
5
+ end
@@ -0,0 +1,10 @@
1
+ require 'bundler'
2
+
3
+ begin
4
+ require 'vagrant'
5
+ rescue LoadError
6
+ Bundler.require(:default, :development)
7
+ end
8
+
9
+ require 'vagrant-nuke/plugin'
10
+ require 'vagrant-nuke/command'
@@ -0,0 +1,17 @@
1
+ # coding: utf-8
2
+ require File.expand_path('../lib/vagrant-nuke/version', __FILE__)
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = 'vagrant-nuke'
6
+ s.version = Vagrant::Nuke::VERSION
7
+ s.date = '2015-03-13'
8
+ s.authors = ['n00bworks']
9
+ s.email = ['mat@n00bworks.com']
10
+ s.summary = "Delete all existing Vagrant boxes currently stored"
11
+ s.description = "Using Vagrant can collect alot of boxes which after a while can become cluttered. While you can delete them individually Nuke will remove all linked boxes."
12
+ s.files = `git ls-files`.split($\)
13
+ s.executables = s.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
14
+ s.require_paths = ['lib']
15
+ s.homepage = "https://github.com/n00bworks/vagrant-nuke"
16
+ s.license = "MIT"
17
+ end
metadata ADDED
@@ -0,0 +1,56 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: vagrant-nuke
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - n00bworks
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-03-13 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Using Vagrant can collect alot of boxes which after a while can become
14
+ cluttered. While you can delete them individually Nuke will remove all linked boxes.
15
+ email:
16
+ - mat@n00bworks.com
17
+ executables: []
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - .gitignore
22
+ - .travis.yml
23
+ - Gemfile
24
+ - LICENSE.txt
25
+ - README.md
26
+ - Rakefile
27
+ - lib/vagrant-nuke.rb
28
+ - lib/vagrant-nuke/command.rb
29
+ - lib/vagrant-nuke/plugin.rb
30
+ - lib/vagrant-nuke/version.rb
31
+ - vagrant-nuke.gemspec
32
+ homepage: https://github.com/n00bworks/vagrant-nuke
33
+ licenses:
34
+ - MIT
35
+ metadata: {}
36
+ post_install_message:
37
+ rdoc_options: []
38
+ require_paths:
39
+ - lib
40
+ required_ruby_version: !ruby/object:Gem::Requirement
41
+ requirements:
42
+ - - ! '>='
43
+ - !ruby/object:Gem::Version
44
+ version: '0'
45
+ required_rubygems_version: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ! '>='
48
+ - !ruby/object:Gem::Version
49
+ version: '0'
50
+ requirements: []
51
+ rubyforge_project:
52
+ rubygems_version: 2.4.5
53
+ signing_key:
54
+ specification_version: 4
55
+ summary: Delete all existing Vagrant boxes currently stored
56
+ test_files: []