Skip to content

Commit

Permalink
Simplify code to extract full gem name from path by removing explanat…
Browse files Browse the repository at this point in the history
…ory variable
  • Loading branch information
shinokaro committed Jun 2, 2024
1 parent 9609b5a commit 0b806e6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions bin/ocran
Original file line number Diff line number Diff line change
Expand Up @@ -504,8 +504,7 @@ EOF
Gem.path.each do |gempath|
geminstallpath = Pathname(gempath) / "gems"
if feature.subpath?(geminstallpath)
gemlocalpath = feature.relative_path_from(geminstallpath)
fullgemname = gemlocalpath.to_s.split(Pathname::SEPARATOR_PAT).first
fullgemname = feature.relative_path_from(geminstallpath).each_filename.first
gemspecpath = Pathname(gempath) / "specifications" / "#{fullgemname}.gemspec"
if spec = Gem::Specification.load(gemspecpath.to_s)
gems[spec.name] ||= spec
Expand Down

0 comments on commit 0b806e6

Please sign in to comment.