[rubygems/rubygems] Auto-heal empty installation directory
https://github.com/rubygems/rubygems/commit/9720a9b980
This commit is contained in:
parent
78ef59acf7
commit
ac093f4350
@ -259,7 +259,7 @@ module Gem
|
|||||||
end
|
end
|
||||||
|
|
||||||
def installation_missing?
|
def installation_missing?
|
||||||
!default_gem? && !File.directory?(full_gem_path)
|
!default_gem? && (!Dir.exist?(full_gem_path) || Dir.empty?(full_gem_path))
|
||||||
end
|
end
|
||||||
|
|
||||||
unless VALIDATES_FOR_RESOLUTION
|
unless VALIDATES_FOR_RESOLUTION
|
||||||
|
@ -100,12 +100,23 @@ RSpec.describe "bundle install with gem sources" do
|
|||||||
gem 'myrack'
|
gem 'myrack'
|
||||||
G
|
G
|
||||||
|
|
||||||
FileUtils.rm_rf(default_bundle_path("gems/myrack-1.0.0"))
|
gem_dir = default_bundle_path("gems/myrack-1.0.0")
|
||||||
|
|
||||||
|
FileUtils.rm_rf(gem_dir)
|
||||||
|
|
||||||
bundle "install --verbose"
|
bundle "install --verbose"
|
||||||
|
|
||||||
expect(out).to include("Installing myrack 1.0.0")
|
expect(out).to include("Installing myrack 1.0.0")
|
||||||
expect(default_bundle_path("gems/myrack-1.0.0")).to exist
|
expect(gem_dir).to exist
|
||||||
|
expect(the_bundle).to include_gems("myrack 1.0.0")
|
||||||
|
|
||||||
|
FileUtils.rm_rf(gem_dir)
|
||||||
|
Dir.mkdir(gem_dir)
|
||||||
|
|
||||||
|
bundle "install --verbose"
|
||||||
|
|
||||||
|
expect(out).to include("Installing myrack 1.0.0")
|
||||||
|
expect(gem_dir).to exist
|
||||||
expect(the_bundle).to include_gems("myrack 1.0.0")
|
expect(the_bundle).to include_gems("myrack 1.0.0")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user