vagrant-lube 0.1.4 → 0.1.5

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.
data/Gemfile CHANGED
@@ -1,4 +1,5 @@
1
- source :rubygems
1
+
2
+ source 'https://rubygems.org'
2
3
 
3
4
  # Specify gem's dependencies in vagrant-ip.gemspec
4
5
  gemspec
@@ -4,11 +4,11 @@ module Vagrant
4
4
  module Action
5
5
  module VM
6
6
  class SetHostName
7
- def initialize(app, env)
7
+ def initialize app, env
8
8
  @app = app
9
9
  end
10
10
 
11
- def call(env)
11
+ def call env
12
12
  if env[:vm].config.vm.host_name.nil?
13
13
  host = File.basename(env[:vm].env.root_path).gsub(/_/, '-')
14
14
  env[:vm].config.vm.host_name = "#{host}.vagrantup.com"
@@ -20,14 +20,12 @@ module Vagrant
20
20
  end
21
21
  end
22
22
 
23
- def change_host_name(name)
24
- vm.ssh.execute do |ssh|
25
- # Only do this if the hostname is not already set
26
- if !ssh.test?("sudo hostname | grep '#{name}'")
27
- ssh.exec!("sudo sed -i 's/^.*$/#{name}/' /etc/HOSTNAME")
28
- ssh.exec!("sudo hostname #{name}")
29
- ssh.exec!("sudo sed -i 's@^\\(127[.]0[.]0[.]1[[:space:]]\\+\\)@\\1#{name} #{name.split('.')[0]} @' /etc/hosts")
30
- end
23
+ def change_host_name name
24
+ # Only do this if the hostname is not already set
25
+ if !vm.channel.test("sudo hostname | grep '#{name}'")
26
+ vm.channel.sudo("sed -i 's/\\(linux\\).*/\\1#{name}/' /etc/HOSTNAME")
27
+ vm.channel.sudo("hostname #{name}")
28
+ vm.channel.sudo("sed -i 's@^\\(127[.]0[.]0[.]1[[:space:]]\\+\\)@\\1#{name} #{name.split('.')[0]} @' /etc/hosts")
31
29
  end
32
30
  end
33
31
  end
@@ -1,6 +1,6 @@
1
1
 
2
2
  module Vagrant
3
3
  module Lube
4
- VERSION = '0.1.4'
4
+ VERSION = '0.1.5'
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-lube
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-22 00:00:00.000000000 Z
12
+ date: 2013-02-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: vagrant