Skip to content
This repository has been archived by the owner on Nov 2, 2019. It is now read-only.

Commit

Permalink
Some changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Demitri Swan committed Jun 12, 2015
1 parent 27b4328 commit defc2aa
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
source "https://rubygems.org"

gem 'rake'

group :development do
gem "vagrant", git: "https://github.com/mitchellh/vagrant.git"
end
Expand Down
1 change: 1 addition & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
require "bundler/gem_tasks"

Bundler::GemHelper.install_tasks
12 changes: 7 additions & 5 deletions lib/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@
require 'find'
require 'mixlib/shellout'
require 'vagrant'
require 'optparse'

module Vbinfo
class Command < Vagrant.plugin("2", :command)

def self.synopsis
"Outputs information for each Virtualbox VM in a given project"
end

# Return an array of vm IDs for the vagrant project in the
# current directory
def ids
Expand Down Expand Up @@ -41,12 +47,8 @@ def execute
o.banner = "Usage: vagrant vbinfo"
end

argv = parse_options(opts)

return if !argv

ids.each do |id|
puts "#{get_info(id).to_s}\n\n"
@env.ui.info("#{get_info(id).to_s}\n\n")
end
exit 0
end
Expand Down
3 changes: 1 addition & 2 deletions lib/plugin.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env ruby

require_relative "vbinfo/version"
require 'vagrant'

module Vbinfo
Expand All @@ -12,7 +11,7 @@ class Plugin < Vagrant.plugin("2")
DESC

command("vbinfo") do
require_relative 'command'
require File.expand_path("../command", __FILE__)
Command
end
end
Expand Down

0 comments on commit defc2aa

Please sign in to comment.