[前][次][番号順一覧][スレッド一覧]

ruby-changes:62807

From: Jeremy <ko1@a...>
Date: Thu, 3 Sep 2020 02:37:58 +0900 (JST)
Subject: [ruby-changes:62807] cc5b7ed1dc (master): Document limitation of Pathname#relative_path_from [ci skip]

https://git.ruby-lang.org/ruby.git/commit/?id=cc5b7ed1dc

From cc5b7ed1dccc6a5cffa5c52778c6db8794722404 Mon Sep 17 00:00:00 2001
From: Jeremy Evans <code@j...>
Date: Wed, 2 Sep 2020 10:34:33 -0700
Subject: Document limitation of Pathname#relative_path_from [ci skip]

This method is explicitly documented to not access the filesystem,
and the only way to get the correct behavior for a case where the
filesystem's case sensitivity differs from the operating system
default would be to access the filesystem.

Fixes [Bug #15417]

diff --git a/ext/pathname/lib/pathname.rb b/ext/pathname/lib/pathname.rb
index dc4a7c0..5274286 100644
--- a/ext/pathname/lib/pathname.rb
+++ b/ext/pathname/lib/pathname.rb
@@ -502,6 +502,9 @@ class Pathname https://github.com/ruby/ruby/blob/trunk/ext/pathname/lib/pathname.rb#L502
   #
   # ArgumentError is raised when it cannot find a relative path.
   #
+  # Note that this method does not handle situations where the case sensitivity
+  # of the filesystem in use differs from the operating system default.
+  #
   def relative_path_from(base_directory)
     base_directory = Pathname.new(base_directory) unless base_directory.is_a? Pathname
     dest_directory = self.cleanpath.to_s
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]