Class: RightConf::RubyConfigurator
- Inherits:
-
Object
- Object
- RightConf::RubyConfigurator
- Includes:
- Configurator
- Defined in:
- lib/rconf/configurators/ruby_configurator.rb
Constant Summary collapse
- RVM_VERSION =
RVM version used to install rubies
'1.2.6'
Instance Method Summary collapse
-
#run_linux ⇒ Object
(also: #run_darwin)
Switch to ruby version defined in settings Use rvm and install it if needed.
-
#run_windows ⇒ Object
Switch to ruby version defined in settings TBD.
Methods included from Configurator
#[], included, #run, #validate
Methods included from ProgressReporter
included, report_to_file, report_to_stdout
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class RightConf::Configurator
Instance Method Details
#run_linux ⇒ Object Also known as: run_darwin
Switch to ruby version defined in settings Use rvm and install it if needed
Return
- true
-
Always return true
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/rconf/configurators/ruby_configurator.rb', line 37 def run_linux check_rvm(RVM_VERSION) report_check("Checking whether #{ruby_version} is the active ruby") out = Command.execute('rvm', 'list').output if out =~ /^=> #{ruby_version.gsub('.', '\\.')}/ report_success else report_failure report_check("Switching to #{ruby_version}") out = Command.execute('rvm', 'use', ruby_version).output case out when /is not installed\./ report_failure report_fatal "Failed to install #{ruby}: #{@out}" if @out @out = install_ruby(ruby_version) run return true when /^Using / report_success check_rvmrc post_note 'Configuration required switching the active ruby, please "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', 'use', gemset, :abort_on_failure => "Failed to switch to gemset '#{gemset}'") report_success end Command.set_prefix("rvm #{ruby_version}@#{gemset} exec --") true end |
#run_windows ⇒ Object
Switch to ruby version defined in settings TBD
Return
- true
-
Always return true
78 79 |
# File 'lib/rconf/configurators/ruby_configurator.rb', line 78 def run_windows end |