Skip to content

Commit

Permalink
Use expand_path on relative feature paths in find_load_path
Browse files Browse the repository at this point in the history
Previously, relative feature paths were ignored during gemspec searches. By using the return value of find_load_path to correctly expand these paths to absolute paths, the associated gemspecs can now be properly located and are no longer overlooked.
  • Loading branch information
shinokaro committed Jun 19, 2024
1 parent a42f59a commit 098e857
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bin/ocran
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,9 @@ EOF
features.each do |feature|
# Detect load path unless absolute
if feature.relative?
feature = find_load_path($LOAD_PATH.map { |path| Pathname(path) }, feature)
next if feature.nil? # Could be enumerator.so
load_path = find_load_path($LOAD_PATH.map { |path| Pathname(path) }, feature)
next if load_path.nil? # Could be enumerator.so
feature = feature.expand_path(load_path)
end
# Skip if found in known Gem dir
if gems.find { |gem, spec| feature.subpath?(spec.gem_dir) }
Expand Down

0 comments on commit 098e857

Please sign in to comment.