remy 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -35,15 +35,24 @@ module Remy
35
35
 
36
36
  def install_rvm
37
37
  remote_execute rvm_multi_user_install
38
+ add_root_user_to_rvm_group
38
39
  apt_get_rvm_packages
39
- remote_execute "/usr/local/rvm/bin/rvm install #{ruby_version}"
40
- remote_execute "/usr/local/rvm/bin/rvm #{ruby_version} --default"
40
+ remote_execute "#{source_rvm_sh} && rvm install #{ruby_version}"
41
+ remote_execute "#{source_rvm_sh} && rvm use #{ruby_version} --default"
41
42
  end
42
43
 
43
44
  def rvm_multi_user_install
44
45
  'curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer -o rvm-installer ; chmod +x rvm-installer ; sudo -s ./rvm-installer --version latest'
45
46
  end
46
47
 
48
+ def source_rvm_sh
49
+ "source /etc/profile.d/rvm.sh"
50
+ end
51
+
52
+ def add_root_user_to_rvm_group
53
+ remote_execute "usermod -a -G rvm root"
54
+ end
55
+
47
56
  def is_ssh_copy_id_installed_locally?
48
57
  `which ssh-copy-id`.length > 0
49
58
  end
@@ -68,7 +77,7 @@ module Remy
68
77
  raise ArgumentError.new unless version.match(/^\d[.\d]+\d/)
69
78
  version_info = "-v #{version}"
70
79
  end
71
- remote_execute "/usr/local/rvm/bin/gem install #{gem_name} #{version_info} --no-rdoc --no-ri"
80
+ remote_execute "#{source_rvm_sh} && gem install #{gem_name} #{version_info} --no-rdoc --no-ri"
72
81
  end
73
82
 
74
83
  def remote_apt_get(package_name)
data/lib/remy/remy.rb CHANGED
@@ -48,7 +48,7 @@ module Remy
48
48
  begin
49
49
  configuration.deep_merge!(YAML.load(ERB.new(File.read(filename)).result) || {})
50
50
  rescue SystemCallError, IOError
51
- warn "WARN: #{filename} could not be found!"
51
+ # do nothing if the chef.yml file could not be read (it's not needed for every usage of remy, just certain ones)
52
52
  end
53
53
  end
54
54
  end
data/lib/remy/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Remy
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: remy
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Greg Woodward & Ryan Dy
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-12-10 00:00:00 Z
18
+ date: 2011-12-28 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: bourne