# File lib/bundler/installer/gem_installer.rb, line 6 def initialize(spec, installer, standalone = false, worker = 0, force = false) @spec = spec @installer = installer @standalone = standalone @worker = worker @force = force end
# File lib/bundler/installer/gem_installer.rb, line 14 def install_from_spec post_install_message = spec_settings ? install_with_settings : install Bundler.ui.debug "#{worker}: #{spec.name} (#{spec.version}) from #{spec.loaded_from}" generate_executable_stubs return true, post_install_message rescue Bundler::InstallHookError, Bundler::SecurityError raise rescue Errno::ENOSPC return false, out_of_space_message rescue => e return false, specific_failure_message(e) end
# File lib/bundler/installer/gem_installer.rb, line 36 def failure_message return install_error_message if spec.source.options["git"] "#{install_error_message}\n#{gem_install_message}" end
# File lib/bundler/installer/gem_installer.rb, line 45 def gem_install_message "Make sure that `gem install #{spec.name} -v '#{spec.version}'` succeeds before bundling." end
# File lib/bundler/installer/gem_installer.rb, line 67 def generate_executable_stubs if Bundler.settings[:bin] && standalone installer.generate_standalone_bundler_executable_stubs(spec) elsif Bundler.settings[:bin] installer.generate_bundler_executable_stubs(spec, :force => true) end end
# File lib/bundler/installer/gem_installer.rb, line 54 def install spec.source.install(spec, :force => force, :ensure_builtin_gems_cached => standalone) end
# File lib/bundler/installer/gem_installer.rb, line 41 def install_error_message "An error occurred while installing #{spec.name} (#{spec.version}), and Bundler cannot continue." end
# File lib/bundler/installer/gem_installer.rb, line 58 def install_with_settings # Build arguments are global, so this is mutexed Bundler.rubygems.with_build_args([spec_settings]) { install } end
# File lib/bundler/installer/gem_installer.rb, line 63 def out_of_space_message "#{install_error_message}\nYour disk is out of space. Free some space to be able to install your bundle." end
# File lib/bundler/installer/gem_installer.rb, line 49 def spec_settings # Fetch the build settings, if there are any Bundler.settings["build.#{spec.name}"] end
# File lib/bundler/installer/gem_installer.rb, line 29 def specific_failure_message(e) message = "#{e.class}: #{e.message}\n" message += " " + e.backtrace.join("\n ") + "\n\n" if Bundler.ui.debug? message = message.lines.first + Bundler.ui.add_color(message.lines.drop(1).join, :clear) message + Bundler.ui.add_color(failure_message, :red) end