rconf 0.8.30 → 0.9.4

Sign up to get free protection for your applications and to get access to all the features.
data/lib/rconf/command.rb CHANGED
@@ -70,11 +70,12 @@ module RightConf
70
70
  def execute_in_ruby(command, *args)
71
71
  report_fatal('Failed to run in ruby context, no ruby specified') unless @rvm_prefix
72
72
  commands = if RVM_COMMANDS.include?(command)
73
- [ @rvm_prefix, command ]
73
+ @rvm_prefix + [ command ]
74
74
  else
75
- [ @rvm_prefix, 'exec', '--', command ]
75
+ @rvm_prefix + [ 'exec', '--', command ]
76
76
  end
77
77
  args = commands + args
78
+ ENV['rvm_is_not_a_shell_function'] = '0'
78
79
  execute('rvm', *args)
79
80
  end
80
81
 
@@ -132,7 +133,7 @@ module RightConf
132
133
  # === Return
133
134
  # true:: Always return true
134
135
  def set_ruby(ruby, gemset)
135
- @rvm_prefix = "#{ruby}@#{gemset}"
136
+ @rvm_prefix = ["#{ruby}@#{gemset}"]
136
137
  true
137
138
  end
138
139
 
@@ -14,7 +14,7 @@ module RightConf
14
14
  class RubyConfigurator
15
15
 
16
16
  # RVM version used to install rubies
17
- RVM_VERSION = '1.6.2'
17
+ RVM_VERSION = '1.10.2'
18
18
 
19
19
  # RVM releases URL
20
20
  RVM_RELEASES_URL = 'https://rvm.beginrescueend.com/releases'
@@ -59,7 +59,7 @@ module RightConf
59
59
  else
60
60
  report_failure
61
61
  report_check("Switching to #{version}")
62
- out = Command.execute('rvm', 'use', version).output
62
+ out = Command.execute('rvm', 'use', version, :env => { 'rvm_is_not_a_shell_function' => '0' }).output
63
63
  case out
64
64
  when /is not installed\./
65
65
  report_failure
@@ -91,7 +91,8 @@ module RightConf
91
91
  end
92
92
  report_check("Switching to gemset #{gemset}")
93
93
  Command.execute('rvm', version, 'exec', 'rvm', 'gemset', 'use', gemset,
94
- :abort_on_failure => "Failed to switch to gemset '#{gemset}'")
94
+ :abort_on_failure => "Failed to switch to gemset '#{gemset}'",
95
+ :env => { 'rvm_is_not_a_shell_function' => '0' })
95
96
  report_success
96
97
  end
97
98
  if rubygems
@@ -281,19 +282,19 @@ then
281
282
  if [[ -s "${rvm_path:-$HOME/.rvm}/hooks/after_use" ]]
282
283
  then
283
284
  . "${rvm_path:-$HOME/.rvm}/hooks/after_use"
284
- fi
285
+ fi
285
286
  else
286
287
  # If the environment file has not yet been created, use the RVM CLI to select.
287
288
  if ! rvm --create "$environment_id"
288
289
  then
289
290
  echo "Failed to create RVM environment '${environment_id}'."
290
291
  return 1
291
- fi
292
+ fi
292
293
  fi
293
294
  if [[ $- == *i* ]] # check for interactive shells
294
295
  then
295
296
  echo "Using: $(tput setaf 2)$GEM_HOME$(tput sgr0)" # show the user the ruby and gemset they are using in green
296
- else
297
+ else
297
298
  echo "Using: $GEM_HOME" # don't use colors in interactive shells
298
299
  fi
299
300
  EOF
data/lib/rconf/version.rb CHANGED
@@ -12,8 +12,8 @@
12
12
  module RightConf
13
13
 
14
14
  MAJOR = 0
15
- MINOR = 8
16
- BUILD = 30
15
+ MINOR = 9
16
+ BUILD = 4
17
17
 
18
18
  VERSION = [MAJOR, MINOR, BUILD].map(&:to_s).join('.')
19
19
 
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2011 RightScale, Inc, All Rights Reserved Worldwide.
1
+ # Copyright (C) 2011-2012 RightScale, Inc, All Rights Reserved Worldwide.
2
2
  #
3
3
  # THIS PROGRAM IS CONFIDENTIAL AND PROPRIETARY TO RIGHTSCALE
4
4
  # AND CONSTITUTES A VALUABLE TRADE SECRET. Any unauthorized use,
@@ -29,7 +29,7 @@ describe RightConf::RubyConfigurator do
29
29
  it 'should succeed on linux when rvm succeeds' do
30
30
  should_execute('rvm', '--version').once.and_return(success_result("rvm #{RVM_VERSION}"))
31
31
  should_execute('rvm', 'list').once.and_return(success_result("=> rvm #{RVM_VERSION}"))
32
- should_execute('rvm', 'use', '0').once.and_return(success_result('Using '))
32
+ should_execute('rvm', 'use', '0', Hash).once.and_return(success_result('Using '))
33
33
  should_execute('rvm', '0@', 'gem', '--version').once.and_return(success_result('1'))
34
34
  @configurator.run_linux
35
35
  end
@@ -50,7 +50,7 @@ describe RightConf::RubyConfigurator do
50
50
  it 'should install rubygems if needed' do
51
51
  should_execute('rvm', '--version').once.and_return(success_result("rvm #{RVM_VERSION}"))
52
52
  should_execute('rvm', 'list').once.and_return(success_result("=> rvm #{RVM_VERSION}"))
53
- should_execute('rvm', 'use', '0').once.and_return(success_result('Using '))
53
+ should_execute('rvm', 'use', '0', Hash).once.and_return(success_result('Using '))
54
54
  should_execute('rvm', '0@', 'gem', '--version').once.and_return(success_result('0'))
55
55
  should_execute('rvm', '0@', 'rubygems', '1',
56
56
  {:abort_on_failure=>'Failed to install rubygems'}).once.and_return(success_result)
metadata CHANGED
@@ -4,10 +4,10 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 8
8
- - 30
7
+ - 9
8
+ - 4
9
9
  segments_generated: true
10
- version: 0.8.30
10
+ version: 0.9.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Raphael Simon
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-01-29 00:00:00 -08:00
18
+ date: 2012-02-02 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency