Skip to content
This repository has been archived by the owner on Sep 7, 2021. It is now read-only.

Commit

Permalink
implemented 'vagrant ip' command
Browse files Browse the repository at this point in the history
  • Loading branch information
mkuzmin committed Jan 5, 2015
1 parent 2d81e3a commit 7751049
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ tmp
*.o
*.a
mkmf.log
Vagrantfile
.vagrant/
2 changes: 0 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
source 'https://rubygems.org'

gemspec

group :development do
gem 'vagrant', git: 'https://github.com/mitchellh/vagrant.git'
end
Expand Down
8 changes: 7 additions & 1 deletion lib/command.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
module VagrantPlugins
module GuestIP
class Command < Vagrant.plugin(2, :command)
def self.synopsis
'outputs IP address of a guest machine'
end

def execute
puts "Hello!"
with_target_vms(nil, {:single_target=>true}) do |machine|
puts machine.guest.capability(:read_ip_address)
end
end
end
end
Expand Down

0 comments on commit 7751049

Please sign in to comment.