summaryrefslogtreecommitdiff
path: root/ext/pathname/lib
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2020-09-02 10:34:33 -0700
committerJeremy Evans <code@jeremyevans.net>2020-09-02 10:34:33 -0700
commitcc5b7ed1dccc6a5cffa5c52778c6db8794722404 (patch)
tree4ee13760df411098c11943ae0b91aa25d429d181 /ext/pathname/lib
parent93b78abd774109d1333d59eaf439b2e69ed0fe00 (diff)
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]
Diffstat (limited to 'ext/pathname/lib')
-rw-r--r--ext/pathname/lib/pathname.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/pathname/lib/pathname.rb b/ext/pathname/lib/pathname.rb
index dc4a7c0220..5274286358 100644
--- a/ext/pathname/lib/pathname.rb
+++ b/ext/pathname/lib/pathname.rb
@@ -502,6 +502,9 @@ class Pathname
#
# 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