Skip to content

Commit

Permalink
Remove spec file before building
Browse files Browse the repository at this point in the history
This might fix #750, but I'm not sure because I can't reproduce it.
  • Loading branch information
drbrain committed Dec 19, 2013
1 parent d6e66c0 commit af60443
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/rubygems/installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ def spec
def install
pre_install_checks

FileUtils.rm_f File.join gem_home, 'specifications', @spec.spec_name

run_pre_install_hooks

# Completely remove any previous gem files
Expand Down
4 changes: 4 additions & 0 deletions test/rubygems/test_gem_installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -645,21 +645,25 @@ def test_install
cache_file = File.join @gemhome, 'cache', @spec.file_name
stub_exe = File.join @gemhome, 'bin', 'executable'
rakefile = File.join gemdir, 'ext', 'a', 'Rakefile'
spec_file = File.join @gemhome, 'specifications', @spec.spec_name

Gem.pre_install do |installer|
refute_path_exists cache_file, 'cache file must not exist yet'
refute_path_exists spec_file, 'spec file must not exist yet'
true
end

Gem.post_build do |installer|
assert_path_exists gemdir, 'gem install dir must exist'
assert_path_exists rakefile, 'gem executable must exist'
refute_path_exists stub_exe, 'gem executable must not exist'
refute_path_exists spec_file, 'spec file must not exist yet'
true
end

Gem.post_install do |installer|
assert_path_exists cache_file, 'cache file must exist'
assert_path_exists spec_file, 'spec file must exist'
end

@newspec = nil
Expand Down

0 comments on commit af60443

Please sign in to comment.