Class: Bundler::GemInstaller

Inherits:
Object
  • Object
show all
Defined in:
lib/bundler/installer/gem_installer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(spec, installer, standalone = false, worker = 0, force = false) ⇒ GemInstaller

Returns a new instance of GemInstaller.



9
10
11
12
13
14
15
# File 'lib/bundler/installer/gem_installer.rb', line 9

def initialize(spec, installer, standalone = false, worker = 0, force = false)
  @spec = spec
  @installer = installer
  @standalone = standalone
  @worker = worker
  @force = force
end

Instance Attribute Details

#forceObject (readonly)

Returns the value of attribute force.



7
8
9
# File 'lib/bundler/installer/gem_installer.rb', line 7

def force
  @force
end

#installerObject (readonly)

Returns the value of attribute installer.



7
8
9
# File 'lib/bundler/installer/gem_installer.rb', line 7

def installer
  @installer
end

#specObject (readonly)

Returns the value of attribute spec.



7
8
9
# File 'lib/bundler/installer/gem_installer.rb', line 7

def spec
  @spec
end

#standaloneObject (readonly)

Returns the value of attribute standalone.



7
8
9
# File 'lib/bundler/installer/gem_installer.rb', line 7

def standalone
  @standalone
end

#workerObject (readonly)

Returns the value of attribute worker.



7
8
9
# File 'lib/bundler/installer/gem_installer.rb', line 7

def worker
  @worker
end

Instance Method Details

#install_from_specObject



17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/bundler/installer/gem_installer.rb', line 17

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, APIResponseMismatchError
  raise
rescue Errno::ENOSPC
  return false, out_of_space_message
rescue StandardError => e
  return false, specific_failure_message(e)
end