Skip to content

Commit

Permalink
Rename duplicate_from_exec_prefix to duplicate_to_exec_prefix for cla…
Browse files Browse the repository at this point in the history
…rity

In this commit, the method name has been updated from `duplicate_from_exec_prefix` to `duplicate_to_exec_prefix`. This change more accurately reflects the method's functionality, which emphasizes duplicating items to a target location based on the `exec_prefix`, thereby improving the clarity and readability of the code.

Key Change:
- Renamed `duplicate_from_exec_prefix` to `duplicate_to_exec_prefix` to clearly indicate that the method duplicates content to a destination derived from the `exec_prefix`.

This modification enhances the semantic precision of the method name, making it easier for developers to understand the method's purpose at a glance.
  • Loading branch information
shinokaro committed Jun 18, 2024
1 parent e56448a commit 754c966
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions bin/ocran
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ EOF
Ocran.detect_dlls.each do |dll|
Ocran.msg "Adding detected DLL #{dll}"
if dll.subpath?(exec_prefix)
builder.duplicate_from_exec_prefix(dll)
builder.duplicate_to_exec_prefix(dll)
else
builder.copy_to_bin(dll, dll.basename)
end
Expand All @@ -624,7 +624,7 @@ EOF
# Add external manifest files
[Ocran.ruby_builtin_manifest].compact.each do |manifest|
Ocran.msg "Adding external manifest #{manifest}"
builder.duplicate_from_exec_prefix(manifest)
builder.duplicate_to_exec_prefix(manifest)
end

# Add extra DLLs specified on the command line
Expand All @@ -636,7 +636,7 @@ EOF
# Add gemspec files
@gemspecs.uniq.each do |gemspec|
if gemspec.subpath?(exec_prefix)
builder.duplicate_from_exec_prefix(gemspec)
builder.duplicate_to_exec_prefix(gemspec)
elsif defined?(Gem) and (gem_path = find_gem_path(gemspec))
builder.duplicate_to_gem_home(gemspec, gem_path)
else
Expand All @@ -648,7 +648,7 @@ EOF
# GEMHOME.
gem_files.each do |gemfile|
if gemfile.subpath?(exec_prefix)
builder.duplicate_from_exec_prefix(gemfile)
builder.duplicate_to_exec_prefix(gemfile)
elsif defined?(Gem) and (gem_path = find_gem_path(gemfile))
builder.duplicate_to_gem_home(gemfile, gem_path)
else
Expand Down Expand Up @@ -698,7 +698,7 @@ EOF
if fullpath.subpath?(exec_prefix)
# Features found in the Ruby installation are put in the
# temporary Ruby installation.
builder.duplicate_from_exec_prefix(fullpath)
builder.duplicate_to_exec_prefix(fullpath)
elsif defined?(Gem) and (gem_path = find_gem_path(fullpath))
# Features found in any other Gem path (e.g. ~/.gems) is put
# in a special 'gemhome' folder.
Expand Down
2 changes: 1 addition & 1 deletion lib/ocran/build_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def copy_to_lib(source, target)
cp(source, LIBDIR / target)
end

def duplicate_from_exec_prefix(source)
def duplicate_to_exec_prefix(source)
cp(source, Pathname(source).relative_path_from(HostConfigHelper.exec_prefix))
end

Expand Down

0 comments on commit 754c966

Please sign in to comment.