D
Daniel Berger
Hi all,
Ruby 1.8.6p111
I'm curious about the result of Pathname#relative_path_from. Consider
this:
require 'pathname'
path1 = Pathname.new('a')
path2 = Pathname.new('b')
path1.relative_path_from(path2).to_s => => "../a"
My first question is philosophical. Should this method work at all
with two relative paths? Or, in the interests of being useful instead
of correct, should we just assume a common root?
My second question is technical. Should the result be "./a"? I mean,
if we assume a common root, the a and b files are in the same
directory, not the parent directory, correct?
Thanks,
Dan
Ruby 1.8.6p111
I'm curious about the result of Pathname#relative_path_from. Consider
this:
require 'pathname'
path1 = Pathname.new('a')
path2 = Pathname.new('b')
path1.relative_path_from(path2).to_s => => "../a"
My first question is philosophical. Should this method work at all
with two relative paths? Or, in the interests of being useful instead
of correct, should we just assume a common root?
My second question is technical. Should the result be "./a"? I mean,
if we assume a common root, the a and b files are in the same
directory, not the parent directory, correct?
Thanks,
Dan