るりまサーチ (Ruby 2.6.0)

最速Rubyリファレンスマニュアル検索!
2件ヒット [1-2件を表示] (0.036秒)
トップページ > バージョン:2.6.0[x] > クエリ:File[x] > クエリ:expand_path[x] > クラス:Dir[x]

別のキーワード

  1. pathname expand_path
  2. rbconfig expand
  3. file expand_path
  4. _builtin expand_path
  5. text expand_tabs

ライブラリ

検索結果

Dir.home -> String | nil (112.0)

現在のユーザまたは指定されたユーザのホームディレクトリを返します。

...されたユーザのホームディレクトリを返します。

Dir
.home や Dir.home("root") は
File.expand_path("~") や File.expand_path("~root") と
ほぼ同じです。

//emlist[例][ruby]{
Dir
.home # => "/home/vagrant"
Dir
.home("root") # => "/root"
//}

@see File.expand_path...

Dir.home(user) -> String | nil (112.0)

現在のユーザまたは指定されたユーザのホームディレクトリを返します。

...されたユーザのホームディレクトリを返します。

Dir
.home や Dir.home("root") は
File.expand_path("~") や File.expand_path("~root") と
ほぼ同じです。

//emlist[例][ruby]{
Dir
.home # => "/home/vagrant"
Dir
.home("root") # => "/root"
//}

@see File.expand_path...