Skip to content

Commit

Permalink
prepend on build_exe
Browse files Browse the repository at this point in the history
  • Loading branch information
shinokaro committed May 29, 2024
1 parent fa96868 commit 4e38572
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions bin/ocran
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -111,8 +101,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?$/
Expand Down Expand Up @@ -634,6 +622,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
Expand Down

0 comments on commit 4e38572

Please sign in to comment.