vagrant-ip-show 0.0.1

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,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7abca7f888d68d7392ed0cae9ae7bccad280dec3
4
+ data.tar.gz: d8eb34ac7491206564ace2ed31bd18c247d3f3f6
5
+ SHA512:
6
+ metadata.gz: 0c98efe4df08c160b962eda27a5849ef9b95939c53d0b21afef9bfc8ed0c1d4baf9daf1a0e42eebc4a56ac90808d072986da0a81ed1c3119107c3458d0e67c91
7
+ data.tar.gz: e8fab3403ff54922e92604c538b3c47df41e853f301a5886d7ba383ab053fb29b68b43bfd48692d925e8da704655e53b194e57cef43e94293bb23d4ef37b47f6
data/.gitignore ADDED
@@ -0,0 +1,6 @@
1
+ /pkg/
2
+ /tmp/
3
+ /.bundle/
4
+ /vendor/bundle/
5
+ Gemfile.lock
6
+ results.html
data/Gemfile ADDED
@@ -0,0 +1,9 @@
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-ip-show", path: "."
9
+ end
data/README.md ADDED
@@ -0,0 +1,2 @@
1
+ # vagrant-ip-show
2
+ A simple vagrant plugin for listing all ip of VM networks
data/Rakefile ADDED
@@ -0,0 +1,3 @@
1
+ require 'rubygems'
2
+ require 'bundler/setup'
3
+ Bundler::GemHelper.install_tasks
@@ -0,0 +1,11 @@
1
+ # lib/vagrant-ip-show.rb
2
+ require 'bundler'
3
+
4
+ begin
5
+ require 'vagrant'
6
+ rescue LoadError
7
+ Bundler.require(:default, :development)
8
+ end
9
+
10
+ require 'vagrant-ip-show/plugin'
11
+ require 'vagrant-ip-show/command'
@@ -0,0 +1,21 @@
1
+ # lib/vagrant-ip-show/command.rb
2
+ module Vagrant
3
+ module IpShow
4
+ class Command < Vagrant.plugin('2', :command)
5
+
6
+ def execute
7
+ # Execute the actual SSH
8
+ with_target_vms(nil, single_target: true) do |vm|
9
+
10
+ @logger.info("Getting ips of vm networks")
11
+ ssh_opts = {extra_args: ['-q']} # make it quiet
12
+ env = vm.action(:ssh_run, ssh_run_command: "ifconfig | grep 'inet addr:' | grep -v 127.0.0.1 | sed -e 's/Bcast//' | cut -d: -f2", ssh_opts: ssh_opts)
13
+
14
+ status = env[:ssh_run_exit_status] || 0
15
+ return status
16
+ end
17
+ end
18
+ end
19
+ end
20
+
21
+ end
@@ -0,0 +1,20 @@
1
+ # lib/vagrant-ip-show/plugin.rb
2
+ module Vagrant
3
+
4
+ module IpShow
5
+
6
+ class Plugin < Vagrant.plugin('2')
7
+ name "IpShow"
8
+
9
+ description <<-DESC
10
+ This plugin runs ifconfig/ipconfig in order to return 'ip'(s) of all of the vm's networks
11
+ DESC
12
+
13
+ command 'ip-show' do
14
+ require_relative 'command'
15
+ Command
16
+ end
17
+
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,6 @@
1
+ # lib/vagrant-ip/version.rb
2
+ module Vagrant
3
+ module IpShow
4
+ VERSION = '0.0.1'
5
+ end
6
+ end
@@ -0,0 +1,16 @@
1
+ require File.expand_path('../lib/vagrant-ip-show/version', __FILE__)
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = 'vagrant-ip-show'
5
+ s.version = Vagrant::IpShow::VERSION
6
+ s.date = '2015-10-07'
7
+ s.summary = "List all ips of VM networks"
8
+ s.description = "A simple vagrant plugin for listing all ip of VM networks"
9
+ s.authors = ["Rogerio Prado de Jesus"]
10
+ s.email = 'rogeriopradoj@gmail.com'
11
+ s.files = `git ls-files`.split($\)
12
+ s.executables = s.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
13
+ s.require_paths = ['lib']
14
+ s.homepage = 'https://github.com/rogeriopradoj/vagrant-ip-show'
15
+ s.license = 'MIT'
16
+ end
metadata ADDED
@@ -0,0 +1,52 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: vagrant-ip-show
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Rogerio Prado de Jesus
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-10-07 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: A simple vagrant plugin for listing all ip of VM networks
14
+ email: rogeriopradoj@gmail.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - ".gitignore"
20
+ - Gemfile
21
+ - README.md
22
+ - Rakefile
23
+ - lib/vagrant-ip-show.rb
24
+ - lib/vagrant-ip-show/command.rb
25
+ - lib/vagrant-ip-show/plugin.rb
26
+ - lib/vagrant-ip-show/version.rb
27
+ - vagrant-ip.gemspec
28
+ homepage: https://github.com/rogeriopradoj/vagrant-ip-show
29
+ licenses:
30
+ - MIT
31
+ metadata: {}
32
+ post_install_message:
33
+ rdoc_options: []
34
+ require_paths:
35
+ - lib
36
+ required_ruby_version: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ required_rubygems_version: !ruby/object:Gem::Requirement
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ requirements: []
47
+ rubyforge_project:
48
+ rubygems_version: 2.4.5
49
+ signing_key:
50
+ specification_version: 4
51
+ summary: List all ips of VM networks
52
+ test_files: []