Class: RightConf::RubyConfigurator

Inherits:
Object
  • Object
show all
Includes:
Configurator
Defined in:
lib/rconf/configurators/ruby_configurator.rb

Instance Method Summary collapse

Methods included from Configurator

#[], #check, included, #post_process, #run, #signature, #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

#check_linuxObject Also known as: check_darwin, check_windows

Let configurator run, it is idempotent

Return

false

Always return false



29
30
31
# File 'lib/rconf/configurators/ruby_configurator.rb', line 29

def check_linux
  false
end

#run_linuxObject Also known as: run_darwin

Switch to ruby version defined in settings Use rbenv and install it if needed

Return

true

Always return true



40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/rconf/configurators/ruby_configurator.rb', line 40

def run_linux
  if Command.execute('rvm').success?
    report_fatal "rconf detected an installation of RVM, rconf now uses rbenv to configure ruby versions.\n" +
      "Unfortunately rbenv and RVM cannot be installed together on the same machine (see https://github.com/sstephenson/rbenv/).\n" +
      "Please uninstall RVM and try again ('rvm implode' will delete RVM and all installed rubies and gems).\n" +
      "Once RVM is uninstalled please start a new shell (you may also need to remove references to RVM from your ~/.bash_profile)"
    return true
  end
  check_rbenv
  return true if aborting
  check_ruby
  Command.set_ruby(ruby_version)
 true
end

#run_windowsObject

Switch to ruby version defined in settings TBD

Return

true

Always return true



61
62
# File 'lib/rconf/configurators/ruby_configurator.rb', line 61

def run_windows
end