Skip to content

Commit

Permalink
Move path conversion logic to a more relevant location
Browse files Browse the repository at this point in the history
- Relocated the logic for converting a feature's absolute path to a relative path for the load_path. This conversion is only used during duplication to inst_sitelibdir, so it has been moved to that specific location.
  • Loading branch information
shinokaro committed Jun 25, 2024
1 parent 877410a commit 5276020
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bin/ocran
Original file line number Diff line number Diff line change
Expand Up @@ -655,9 +655,6 @@ EOF
if load_path.nil? || load_path.expand_path == Pathname.pwd
source_files << feature unless feature.basename.to_s =~ IGNORE_MODULE_NAMES
else
if feature.absolute?
feature = feature.relative_path_from(load_path.expand_path)
end
fullpath = feature.expand_path(load_path)

if fullpath.subpath?(exec_prefix)
Expand Down Expand Up @@ -686,6 +683,9 @@ EOF
# Ruby sitelibdir. This is automatically in the load path
# when Ruby starts.
inst_sitelibdir = sitelibdir.relative_path_from(exec_prefix)
if feature.absolute?
feature = feature.relative_path_from(load_path.expand_path)
end
builder.cp(fullpath, inst_sitelibdir / feature)
end
end
Expand Down

0 comments on commit 5276020

Please sign in to comment.