Class: Bundler::RubyGemsGemInstaller

Inherits:
Gem::Installer
  • Object
show all
Defined in:
lib/bundler/rubygems_gem_installer.rb

Direct Known Subclasses

Source::Path::Installer

Instance Method Summary collapse

Instance Method Details

#build_extensionsObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/bundler/rubygems_gem_installer.rb', line 15

def build_extensions
  extension_cache_path = options[:bundler_extension_cache_path]
  return super unless extension_cache_path && extension_dir = spec.extension_dir

  extension_dir = Pathname.new(extension_dir)
  build_complete = SharedHelpers.filesystem_access(extension_cache_path.join("gem.build_complete"), :read, &:file?)
  if build_complete && !options[:force]
    SharedHelpers.filesystem_access(extension_dir.parent, &:mkpath)
    SharedHelpers.filesystem_access(extension_cache_path) do
      FileUtils.cp_r extension_cache_path, spec.extension_dir
    end
  else
    super
    if extension_dir.directory? # not made for gems without extensions
      SharedHelpers.filesystem_access(extension_cache_path.parent, &:mkpath)
      SharedHelpers.filesystem_access(extension_cache_path) do
        FileUtils.cp_r extension_dir, extension_cache_path
      end
    end
  end
end

#check_executable_overwrite(filename) ⇒ Object



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

def check_executable_overwrite(filename)
  # Bundler needs to install gems regardless of binstub overwriting
end

#pre_install_checksObject



11
12
13
# File 'lib/bundler/rubygems_gem_installer.rb', line 11

def pre_install_checks
  super && validate_bundler_checksum(options[:bundler_expected_checksum])
end