Skip to content

Commit

Permalink
Remove special behavior from Ocran::Pathname#relative_path_from
Browse files Browse the repository at this point in the history
Ocran::Pathname#relative_path_from had a special behavior compared to Pathname#relative_path_from: when the absolute paths of itself and the argument had different drive letters, it returned the argument's path as is.
However, Ocran's self-extracting executables do not perform installations across different drive letters, and there is no implementation to unify different drive letters before building. It is not an issue if the drive letters of the user's application files and the Ruby environment files are different, but there is no way to determine a single installation destination if the drive letters within each set are different.
This is evident from the fact that the Ocran.find_src_root method treats the result of relative_path_from as an error when it is an absolute path.
  • Loading branch information
shinokaro committed May 30, 2024
1 parent 2d70aa7 commit b2cdf91
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion bin/ocran
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ module Ocran
# be reached from 'src'.
def relative_path_from(other)
other = Pathname.new(other) unless other.is_a?(Pathname)
return other if drive_letter?&.casecmp(other.drive_letter?) != 0

if absolute? != other.absolute?
raise ArgumentError, "both paths must be either absolute or relative"
Expand Down

0 comments on commit b2cdf91

Please sign in to comment.