vagrant-butter 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,3 +1,7 @@
1
1
  source 'http://rubygems.org'
2
2
 
3
+ group :test do
4
+ gem 'rake', '~> 0.9'
5
+ end
6
+
3
7
  gemspec
data/README.md CHANGED
@@ -0,0 +1,27 @@
1
+ # vagrant-butter
2
+
3
+ ## Install
4
+
5
+ ```sh
6
+ gem install vagrant-butter
7
+ ```
8
+
9
+ ## Helpers
10
+
11
+ ### local_ip
12
+
13
+ #### Usage
14
+
15
+ ```ruby
16
+ include Vagrant::Butter::Helpers
17
+ ```
18
+
19
+ ## Patches and Support
20
+
21
+ ### SuSE Halting and Setting Hostname
22
+
23
+ #### Usage
24
+
25
+ ```ruby
26
+ require 'vagrant/butter/systems/suse'
27
+ ```
@@ -0,0 +1,34 @@
1
+ module Vagrant
2
+ module Systems
3
+ class Suse
4
+ def halt
5
+ vm.env.ui.info I18n.t("vagrant.systems.linux.attempting_halt")
6
+ vm.ssh.execute do |ssh|
7
+ ssh.exec!("sudo /sbin/shutdown -hP now")
8
+ end
9
+
10
+ # Wait until the VM's state is actually powered off. If this doesn't
11
+ # occur within a reasonable amount of time (15 seconds by default),
12
+ # then simply return and allow Vagrant to kill the machine.
13
+ count = 0
14
+ while vm.vm.state != :powered_off
15
+ count += 1
16
+
17
+ return if count >= vm.env.config.linux.halt_timeout
18
+ sleep vm.env.config.linux.halt_check_interval
19
+ end
20
+ end
21
+
22
+ def change_host_name(name)
23
+ vm.ssh.execute do |ssh|
24
+ # Only do this if the hostname is not already set
25
+ if !ssh.test?("sudo hostname | grep '#{name}'")
26
+ ssh.exec!("sudo sed -i 's/^.*$/#{name}/' /etc/HOSTNAME")
27
+ ssh.exec!("sudo hostname #{name}")
28
+ ssh.exec!("sudo sed -i 's@^\\(127[.]0[.]0[.]1[[:space:]]\\+\\)@\\1#{name} #{name.split('.')[0]} @' /etc/hosts")
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Vagrant
4
4
  module Butter
5
- VERSION = "0.0.1"
5
+ VERSION = "0.0.2"
6
6
  end
7
7
  end
@@ -15,5 +15,5 @@ Gem::Specification.new do |gem|
15
15
  gem.require_paths = ['lib']
16
16
  gem.version = Vagrant::Butter::VERSION
17
17
 
18
- gem.add_dependency "vagrant", "~> 0.8.2"
18
+ gem.add_dependency "vagrant", "~> 0"
19
19
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-butter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,19 +9,19 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-08-02 00:00:00.000000000Z
12
+ date: 2012-02-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: vagrant
16
- requirement: &2157263740 !ruby/object:Gem::Requirement
16
+ requirement: &2157134260 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 0.8.2
21
+ version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2157263740
24
+ version_requirements: *2157134260
25
25
  description: Smooth out Vagrantfiles with some common helpers and shims
26
26
  email:
27
27
  - fnichol@nichol.ca
@@ -35,6 +35,7 @@ files:
35
35
  - Rakefile
36
36
  - lib/vagrant-butter.rb
37
37
  - lib/vagrant/butter/helpers.rb
38
+ - lib/vagrant/butter/systems/suse.rb
38
39
  - lib/vagrant/butter/version.rb
39
40
  - lib/vagrant_init.rb
40
41
  - vagrant-butter.gemspec
@@ -50,15 +51,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
50
51
  - - ! '>='
51
52
  - !ruby/object:Gem::Version
52
53
  version: '0'
54
+ segments:
55
+ - 0
56
+ hash: -3594635565780566737
53
57
  required_rubygems_version: !ruby/object:Gem::Requirement
54
58
  none: false
55
59
  requirements:
56
60
  - - ! '>='
57
61
  - !ruby/object:Gem::Version
58
62
  version: '0'
63
+ segments:
64
+ - 0
65
+ hash: -3594635565780566737
59
66
  requirements: []
60
67
  rubyforge_project:
61
- rubygems_version: 1.8.6
68
+ rubygems_version: 1.8.10
62
69
  signing_key:
63
70
  specification_version: 3
64
71
  summary: Smooth out Vagrantfiles with some common helpers and shims