11件ヒット
[1-11件を表示]
(0.326秒)
検索結果
-
Pathname
# relative _ path _ from(base _ directory) -> Pathname (18108.0) -
base_directory から self への相対パスを求め、その内容の新しい Pathname オブジェクトを生成して返します。
...上でドライブが違うなど、base_directory から self への相対パスが求められないときに例外が発生します。
//emlist[例][ruby]{
require 'pathname'
path = Pathname.new("/tmp/foo")
base = Pathname.new("/tmp")
path.relative_path_from(base) # => #<Pathname:foo>
//}...