From 52755d47c9a7e8bbaf764cd4c8f7691d9f38f817 Mon Sep 17 00:00:00 2001 From: shinokaro Date: Thu, 30 May 2024 08:22:45 +0900 Subject: [PATCH] prepend on build_exe --- bin/ocran | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/bin/ocran b/bin/ocran index 5fc3620..9525d63 100644 --- a/bin/ocran +++ b/bin/ocran @@ -64,17 +64,7 @@ module Ocran 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" - end - a = to_s.split(Pathname::SEPARATOR_PAT) - b = other.to_s.split(Pathname::SEPARATOR_PAT) - while a.first && b.first && pathequal(a.first, b.first) - a.shift - b.shift - end - b.size.times { a.unshift ".." } - Pathname.new(File.join(*a)) + super end # Determines if 'src' is contained in 'tgt' (i.e. it is a subpath of @@ -86,7 +76,6 @@ module Ocran src_normalized =~ /^#{Regexp.escape tgt_normalized}#{Pathname::SEPARATOR_PAT}/i 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. @@ -111,8 +100,6 @@ module Ocran end end - ::Pathname.prepend(RefinePathname) - IGNORE_MODULE_NAMES = /\A(enumerator.so|rational.so|complex.so|fiber.so|thread.rb|ruby2_keywords.rb)\z/ GEM_SCRIPT_RE = /\.rbw?$/ @@ -634,6 +621,7 @@ EOF end def Ocran.build_exe + ::Pathname.prepend(RefinePathname) all_load_paths = $LOAD_PATH.map { |loadpath| Pathname(loadpath).expand_path } @added_load_paths = ($LOAD_PATH - @load_path_before).map { |loadpath| Pathname(loadpath).expand_path } working_directory = Pathname.pwd