lib/rconf/configurators/ruby_configurator.rb in rconf-0.5.1 vs lib/rconf/configurators/ruby_configurator.rb in rconf-0.5.3

- old
+ new

@@ -54,23 +54,25 @@ when /^Using / report_success check_rvmrc Command.execute('rvm', ruby_version, 'exec', 'gem', 'install', 'rconf', :abort_on_failure => "Failed to install rconf gem in #{ruby_version}") - post_note 'Configuration required switching the active ruby, please "cd" into the project directory again to activate it' + post_note "Configuration required switching the active ruby\nPlease 'cd' into the project directory again to activate it" else report_fatal("Failed to use #{ruby_version}:\n#{out}") end end if gemset report_check("Switching to gemset #{gemset}") - res = Command.execute('rvm', 'gemset', 'list') + res = Command.execute('rvm', ruby_version, 'gemset', 'list') unless res.output =~ /^#{gemset}$/ - Command.execute('rvm', 'gemset', 'create', gemset, + report_check("Creating gemset #{gemset} for #{ruby_version}") + Command.execute('rvm', ruby_version, 'gemset', 'create', gemset, :abort_on_failure => "Failed to create gemset '#{gemset}'") + report_success end - Command.execute('rvm', 'gemset', 'use', gemset, + Command.execute('rvm', ruby_version, 'gemset', 'use', gemset, :abort_on_failure => "Failed to switch to gemset '#{gemset}'") report_success end Command.set_prefix("rvm #{ruby_version}@#{gemset} exec --") true @@ -111,11 +113,11 @@ Command.execute('tar', 'zxf', "rvm-#{version}.tar.gz", :abort_on_failure => "Failed to extract rvm tgz from #{File.join(Dir.getwd, 'rvm-' + version + '.tar.gz')}") end Dir.chdir(File.join(rvm_src, "rvm-#{version}")) do Command.execute('./install', :abort_on_failure => "Failed to install rvm #{version}") - setup_bashrc + setup_bashrc end report_success end true end @@ -167,10 +169,10 @@ content = IO.read(bashrc_path) unless content.include?(rvm_bash_activation) content = rvm_bash_activation + "\n" + content FileUtils.mv(bashrc_path, bashrc_path + '.old') File.open(bashrc_path, 'w') { |f| f.puts content } - post_note 'rvm was installed, please reload your shell to activate it' + post_note 'rvm was installed, please reload your shell to activate it and re-run rconf' end else report_error("Failed to update bashrc to activate rvm, no bashrc found") end end