Skip to content

Commit

Permalink
use plus method in "/"
Browse files Browse the repository at this point in the history
  • Loading branch information
shinokaro committed May 28, 2024
1 parent 6b5e878 commit 8136253
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions bin/ocran
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,18 @@ module Ocran
src_normalized =~ /^#{Regexp.escape tgt_normalized}#{Pathname::SEPARATOR_PAT}/i
end

# Join two pathnames together. Returns the right-hand side if it
# is an absolute path. Otherwise, returns the full path of the
# left + right.
def /(other)
other = Pathname === other ? other : Pathname.new(other)
if other.absolute?
other
else
Pathname.new(plus(@path, other.to_s))
end
end

# Appends the given suffix to the filename, preserving the file extension.
# If the filename has an extension, the suffix is inserted before the extension.
# If the filename does not have an extension, the suffix is appended to the end.
Expand Down

0 comments on commit 8136253

Please sign in to comment.