Skip to content

Commit

Permalink
Adding skipping note if configuration is set for it
Browse files Browse the repository at this point in the history
- Setting updatehost to hook in after
- Updates to gem file
  • Loading branch information
cgsmith committed Nov 8, 2015
1 parent 18bd958 commit f65ad4c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 23 deletions.
20 changes: 7 additions & 13 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
$:.unshift File.expand_path("../lib", __FILE__)

Gem::Specification.new do |s|
s.name = "vagrant-hostsupdater"
s.version = '1.0.0'
s.license = 'MIT'
s.platform = Gem::Platform::RUBY
s.authors = ["Falk Kühnel", "Chris Smith"]
s.email = ["[email protected]", "[email protected]"]
s.homepage = "https://github.com/cogitatio/vagrant-hostsupdater"
s.summary = "Enables Vagrant to update hosts file on the host machine"
s.description = "Enables Vagrant to update hosts file on the host machine"

source 'https://rubygems.org'

group :development do
gem 'vagrant', :git => 'git://github.com/mitchellh/vagrant.git', :tag => 'v1.6.2'
end

group :plugins do
gemspec
end
3 changes: 3 additions & 0 deletions lib/vagrant-hostsupdater/HostsUpdater.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ def getIps
key, options = network[0], network[1]
ip = options[:ip] if (key == :private_network || key == :public_network) && options[:hostsupdater] != "skip"
ips.push(ip) if ip
if options[:hostsupdater] == 'skip'
@ui.info 'Skipping adding host entries (config.vm.network hostsupdater: "skip" is set)'
end
end
return ips
end
Expand Down
2 changes: 1 addition & 1 deletion lib/vagrant-hostsupdater/plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Plugin < Vagrant.plugin('2')

action_hook(:hostsupdater, :machine_action_up) do |hook|
hook.prepend(Action::RemoveHosts)
hook.prepend(Action::UpdateHosts)
hook.after(Action::RemoveHosts, Action::UpdateHosts)
end

action_hook(:hostsupdater, :machine_action_provision) do |hook|
Expand Down
18 changes: 9 additions & 9 deletions vagrant-hostsupdater.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'vagrant-hostsupdater/version'

Gem::Specification.new do |spec|
spec.name = "vagrant-hostsupdater"
spec.name = 'vagrant-hostsupdater'
spec.version = VagrantPlugins::HostsUpdater::VERSION
spec.authors = ["Falk Kühnel"]
spec.email = ["[email protected]"]
spec.authors = ['Falk Kühnel', 'Chris Smith']
spec.email = ['[email protected]', '[email protected]']
spec.description = %q{Enables Vagrant to update hosts file on the host machine}
spec.summary = %q{Enables Vagrant to update hosts file on the host machine}
spec.homepage = "https://github.com/cogitatio/vagrant-hostsupdater"
spec.license = "MIT"
spec.summary = spec.description
spec.homepage = 'https://github.com/cogitatio/vagrant-hostsupdater'
spec.license = 'MIT'

spec.files = `git ls-files`.split($/)
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]
spec.require_paths = ['lib']

spec.add_development_dependency "bundler", "~> 1.3"
spec.add_development_dependency "rake"
spec.add_development_dependency 'bundler', '~> 1.3'
spec.add_development_dependency 'rake'
end

0 comments on commit f65ad4c

Please sign in to comment.