るりまサーチ

最速Rubyリファレンスマニュアル検索!
11件ヒット [1-11件を表示] (0.013秒)
トップページ > クエリ:DEFAULT[x] > ライブラリ:pathname[x]

別のキーワード

  1. uri default_port
  2. _builtin default
  3. socket ai_default
  4. generic default_port
  5. socket ip_default_multicast_ttl

クラス

検索結果

Pathname#expand_path(default_dir = '.') -> Pathname (115.0)

Pathname.new(File.expand_path(self.to_s, *args)) と同じです。

...Pathname.new(File.expand_path(self.to_s, *args)) と同じです。

@param default_dir self が相対パスであれば default_dir を基準に展開されます。

//emlist[例][ruby]{
require "pathname"

path = Pathname("testfile")
Pathname
.pwd # => #<Pathname:/path/to>
path.expand_...
...path # => #<Pathname:/path/to/testfile>
path.expand_path("../") # => #<Pathname:/path/testfile>
//}

@see File.expand_path...