Skip to content

Commit

Permalink
Simulate default gems manually
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt committed Apr 18, 2024
1 parent 0d28fbd commit 89277af
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bundler/spec/support/helpers.rb
Expand Up @@ -321,9 +321,15 @@ def install_gem(path, install_dir, default = false)
raise "OMG `#{path}` does not exist!" unless File.exist?(path)

args = "--no-document --ignore-dependencies --verbose --local --install-dir #{install_dir}"
args += " --default" if default

gem_command "install #{args} '#{path}'"

if default
FileUtils.mkdir_p File.join(install_dir, "specifications", "default")
gem = Pathname.new(path).basename.to_s.match(/(.*)\.gem/)[1]
File.rename File.join(install_dir, "specifications", gem + ".gemspec"),
File.join(install_dir, "specifications", "default", gem + ".gemspec")
end
end

def with_built_bundler(version = nil, &block)
Expand Down

0 comments on commit 89277af

Please sign in to comment.