summaryrefslogtreecommitdiff
path: root/lib/bundler/source/path
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-22 23:08:05 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-22 23:08:05 +0000
commit7825e8363d4b2ccad8e2d3f5eeba9e26f6656911 (patch)
tree83cbcf419e0feeb2ab0fd063ed85e0776eb0081b /lib/bundler/source/path
parent73bed0312895322e0fd18310e840356c8e6af812 (diff)
Postponing the Bundler merge.
I faced a big issue about Bundler with ruby core. I have no time to resolve it issue before 2.5 final release. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/bundler/source/path')
-rw-r--r--lib/bundler/source/path/installer.rb74
1 files changed, 0 insertions, 74 deletions
diff --git a/lib/bundler/source/path/installer.rb b/lib/bundler/source/path/installer.rb
deleted file mode 100644
index a0357ffa39..0000000000
--- a/lib/bundler/source/path/installer.rb
+++ /dev/null
@@ -1,74 +0,0 @@
-# frozen_string_literal: true
-
-module Bundler
- class Source
- class Path
- class Installer < Bundler::RubyGemsGemInstaller
- attr_reader :spec
-
- def initialize(spec, options = {})
- @options = options
- @spec = spec
- @gem_dir = Bundler.rubygems.path(spec.full_gem_path)
- @wrappers = true
- @env_shebang = true
- @format_executable = options[:format_executable] || false
- @build_args = options[:build_args] || Bundler.rubygems.build_args
- @gem_bin_dir = "#{Bundler.rubygems.gem_dir}/bin"
- @disable_extensions = options[:disable_extensions]
-
- if Bundler.requires_sudo?
- @tmp_dir = Bundler.tmp(spec.full_name).to_s
- @bin_dir = "#{@tmp_dir}/bin"
- else
- @bin_dir = @gem_bin_dir
- end
- end
-
- def post_install
- SharedHelpers.chdir(@gem_dir) do
- run_hooks(:pre_install)
-
- unless @disable_extensions
- build_extensions
- run_hooks(:post_build)
- end
-
- generate_bin unless spec.executables.nil? || spec.executables.empty?
-
- run_hooks(:post_install)
- end
- ensure
- Bundler.rm_rf(@tmp_dir) if Bundler.requires_sudo?
- end
-
- private
-
- def generate_bin
- super
-
- if Bundler.requires_sudo?
- SharedHelpers.filesystem_access(@gem_bin_dir) do |p|
- Bundler.mkdir_p(p)
- end
- spec.executables.each do |exe|
- Bundler.sudo "cp -R #{@bin_dir}/#{exe} #{@gem_bin_dir}"
- end
- end
- end
-
- def run_hooks(type)
- hooks_meth = "#{type}_hooks"
- return unless Gem.respond_to?(hooks_meth)
- Gem.send(hooks_meth).each do |hook|
- result = hook.call(self)
- next unless result == false
- location = " at #{$1}" if hook.inspect =~ /@(.*:\d+)/
- message = "#{type} hook#{location} failed for #{spec.full_name}"
- raise InstallHookError, message
- end
- end
- end
- end
- end
-end