Class: RightConf::BundlerConfigurator

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

Constant Summary collapse

DEFAULT_GEM_PATH =
'vendor/system_gems/cache'

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 whether bundler is already installed

Return

true

If bundler is already installed

false

Otherwise



36
37
38
39
40
41
42
# File 'lib/rconf/configurators/bundler_configurator.rb', line 36

def check_linux
  report_check("Checking for bundler #{version}")
  res = Command.execute_in_ruby('bundle', '--version')
  success = (res.output =~ /#{version}/)
  report_result(success)
  success
end

#check_windowsObject

Not implemented on windows

Raise

(Exception)

Always raise



49
50
51
# File 'lib/rconf/configurators/bundler_configurator.rb', line 49

def check_windows
  raise "Bundler is not supported on Windows!"
end

#run_linuxObject Also known as: run_darwin

Install bundler if needed and run bundle install

Return

true

Always return true



57
58
59
60
61
62
63
64
65
66
67
# File 'lib/rconf/configurators/bundler_configurator.rb', line 57

def run_linux
  install_bundler 
  report_check('Installing gems')
  options = [ "_#{version}_", 'install' ]
  options << "--without=#{exclusions.delete(' ')}" unless exclusions.nil?
  options += [ '--path', bundle_path ] unless bundle_path.nil?
  options << { :abort_on_failure => 'Failed to install gems' }
  res = Command.execute_in_ruby('bundle', *options)
  report_success
  true
end

#run_windowsObject

Not implemented on windows

Raise

(Exception)

Always raise



74
75
76
# File 'lib/rconf/configurators/bundler_configurator.rb', line 74

def run_windows
  raise "Bundler is not supported on Windows!"
end