lib/rconf/configurators/bundler_configurator.rb in rconf-0.5.1 vs lib/rconf/configurators/bundler_configurator.rb in rconf-0.5.3
- old
+ new
@@ -33,11 +33,11 @@
def run_linux
report_check("Checking for bundler #{bundler_version}")
res = Command.execute('bundle', '--version')
success = (res.output =~ /#{bundler_version}/)
report_result(success)
- install_bundler(res.success?) unless success
+ install_bundler unless success
report_check('Installing gems')
res = Command.execute('bundle', 'install', :abort_on_failure => 'Failed to install gems')
report_success
true
end
@@ -53,19 +53,17 @@
protected
# Install bundler from gem in cache
#
- # === Parameters
- # exists(FalseClass|TrueClass):: Whether bundler is already installed
- # (but is the wrong version)
- #
# === Return
# true:: Always return true
#
# === Raise
# (Exception):: If bundler gem cannot be found or installed
- def install_bundler(exists)
+ def install_bundler
+ res = Command.execute('bundle', '--version')
+ exists = res.success? && res.output !~ /exec: bundle: not found/
if exists
report_check('Uninstalling existing versions of bundler')
res = Command.execute('gem', 'uninstall', 'bundler', '-a', '-x',
:abort_on_failure => 'Failed to uninstall bundler')
report_success