diff options
author | Asutosh Palai <asupalai@gmail.com> | 2016-06-30 16:51:18 +0530 |
---|---|---|
committer | Asutosh Palai <asupalai@gmail.com> | 2016-07-03 09:41:58 +0530 |
commit | b9b2600fb900a342a7fff8dcdf9153909b7e983e (patch) | |
tree | be23de517ea4e1929178d98f79b587a440c2f0cc /lib/bundler/source/path.rb | |
parent | 5d76c0d8a5486be272087fd5f0642c263d4df33a (diff) | |
download | bundler-b9b2600fb900a342a7fff8dcdf9153909b7e983e.tar.gz |
Separated generate_bin into source/path/installer
Diffstat (limited to 'lib/bundler/source/path.rb')
-rw-r--r-- | lib/bundler/source/path.rb | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/lib/bundler/source/path.rb b/lib/bundler/source/path.rb index bbdd30b1e6..cc97f26a15 100644 --- a/lib/bundler/source/path.rb +++ b/lib/bundler/source/path.rb @@ -203,13 +203,8 @@ module Bundler end end.compact - SharedHelpers.chdir(gem_dir) do - installer = Path::Installer.new(spec, :env_shebang => false) - run_hooks(:pre_install, installer) - build_extensions(installer) unless disable_extensions - installer.generate_bin - run_hooks(:post_install, installer) - end + installer = Path::Installer.new(spec, :env_shebang => false, :disable_extensions => disable_extensions) + installer.post_install rescue Gem::InvalidSpecificationException => e Bundler.ui.warn "\n#{spec.name} at #{spec.full_gem_path} did not have a valid gemspec.\n" \ "This prevents bundler from installing bins or native extensions, but " \ @@ -224,22 +219,6 @@ module Bundler Bundler.ui.warn "The validation message from Rubygems was:\n #{e.message}" end - def build_extensions(installer) - installer.build_extensions - run_hooks(:post_build, installer) - end - - def run_hooks(type, installer) - hooks_meth = "#{type}_hooks" - return unless Gem.respond_to?(hooks_meth) - Gem.send(hooks_meth).each do |hook| - result = hook.call(installer) - next unless result == false - location = " at #{$1}" if hook.inspect =~ /@(.*:\d+)/ - message = "#{type} hook#{location} failed for #{installer.spec.full_name}" - raise InstallHookError, message - end - end end end end |