Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
Revert "reinstalls gem if gem dir is missing but spec exists"
Browse files Browse the repository at this point in the history
It turns out that this has some pretty extensive repurcussions, and
makes it impossible to use Bundler in some specific circumstances, like
with gems that ship with Ruby, and with gems that are installed by distro
packages. It also breaks the `bundle pack` command, because the gems
that are cached by the pack command are not found by this check.

See also:

#2854
#2780

This reverts commit bd0243e.
  • Loading branch information
indirect committed Feb 6, 2014
1 parent 8897c77 commit 06596ca
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 28 deletions.
13 changes: 1 addition & 12 deletions lib/bundler/source/rubygems.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

module Bundler
module Source
# TODO: Refactor this class
class Rubygems
API_REQUEST_LIMIT = 100 # threshold for switching back to the modern index instead of fetching every spec

Expand Down Expand Up @@ -68,7 +67,7 @@ def specs
end

def install(spec)
if installed_specs[spec].any? && gem_dir_exists?(spec)
if installed_specs[spec].any?
return ["Using #{spec.name} (#{spec.version})", nil]
end

Expand Down Expand Up @@ -277,16 +276,6 @@ def remote_specs
end
end

def gem_dir_exists?(spec)
return true if spec.name == "bundler"
# Ruby 2 default gems
return true if spec.loaded_from.include?("specifications/default/")
# Ruby 1.9 default gems
return true if spec.summary =~ /is bundled with Ruby/

File.directory?(spec.full_gem_path)
end
end

end
end
16 changes: 0 additions & 16 deletions spec/install/gems/simple_case_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -337,22 +337,6 @@
G
expect(exitstatus).to eq(0)
end

it "reinstalls the gem if the gem dir is missing but the specification file exists" do
gemfile(<<-G)
source "file://#{gem_repo1}"
gem 'foo'
G

bundle "install --path vendor/bundle"

FileUtils.rm_rf(vendored_gems('gems/foo-1.0'))

bundle "install"

expect(vendored_gems('gems/foo-1.0')).to exist
end
end

describe "when Bundler root contains regex chars" do
Expand Down

0 comments on commit 06596ca

Please sign in to comment.