Skip to content

Commit

Permalink
Try to find gemspec from `.bundle/specifications
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt committed Aug 1, 2024
1 parent ba252fb commit cee7a36
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions tool/rbinstall.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1026,17 +1026,22 @@ def install_default_gem(dir, srcdir, bindir)
File.foreach("#{srcdir}/gems/bundled_gems") do |name|
next if /^\s*(?:#|$)/ =~ name
next unless /^(\S+)\s+(\S+).*/ =~ name
gem = $1
gem_name = "#$1-#$2"
# Try to find the gemspec file
path = "#{srcdir}/.bundle/gems/#{gem_name}/#{name}.gemspec"
# Try to find the original gemspec file
path = "#{srcdir}/.bundle/gems/#{gem_name}/#{gem}.gemspec"
unless File.exist?(path)
# Try to find the gemspec file for C ext gems
# ex .bundle/gems/debug-1.7.1/debug-1.7.1.gemspec
# This gemspec keep the original dependencies
path = "#{srcdir}/.bundle/gems/#{gem_name}/#{gem_name}.gemspec"
unless File.exist?(path)
skipped[gem_name] = "gemspec not found"
next
# Try to find the gemspec file for gems that hasn't own gemspec
path = "#{srcdir}/.bundle/specifications/#{gem_name}.gemspec"
unless File.exist?(path)
skipped[gem_name] = "gemspec not found"
next
end
end
end
spec = load_gemspec(path, "#{srcdir}/.bundle/gems/#{gem_name}")
Expand Down

0 comments on commit cee7a36

Please sign in to comment.