Module: Gem::Installer::Nice

Includes:
UserInteraction
Defined in:
lib/rubygems/nice_install.rb,
lib/rubygems/nice_install/distro_guesser.rb,
lib/rubygems/nice_install/base_ext_installer.rb,
lib/rubygems/nice_install/fedora_ext_installer.rb

Defined Under Namespace

Classes: BaseExtInstaller, DistroGuesser, FedoraExtInstaller

Instance Method Summary collapse

Instance Method Details

#build_extensionsObject



16
17
18
19
20
21
22
23
24
25
# File 'lib/rubygems/nice_install.rb', line 16

def build_extensions
  super
rescue ExtensionBuildError => e
  # Install platform dependencies and try the build again.
  if install_platform_dependencies
    super
  else
    raise
  end
end

#install_platform_dependenciesObject



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/rubygems/nice_install.rb', line 27

def install_platform_dependencies
  if ext_installer = DistroGuesser.distro_ext_installer
    missing_deps = ext_installer.gem_ext_dependencies_for(spec.name).delete_if do |t|
      ext_installer.ext_dependency_present?(t)
    end

    unless missing_deps.empty?
      say "Installing native dependencies for Gem '#{spec.name}': #{missing_deps.join ' '}"
      unless ext_installer.install_ext_dependencies_for(spec.name, missing_deps)
        raise Gem::InstallError, "Failed to install native dependencies for '#{spec.name}'."
      end
    end
    return true
  end
end