るりまサーチ

最速Rubyリファレンスマニュアル検索!
55件ヒット [1-55件を表示] (0.281秒)

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

クラス

モジュール

キーワード

検索結果

File.expand_path(path, default_dir = '.') -> String (26127.0)

path を絶対パスに展開した文字列を返します。 path が相対パスであれば default_dir を基準にします。

...matz/work/foo"
p ENV["HOME"] #=> "/home/matz"
p File.expand_path("..") #=> "/home/matz/work"
p File.expand_path("..", "/tmp") #=> "/"
p File.expand_path("~") #=> "/home/matz"
p File.expand_path("~foo") #=> "/home/foo"
//}

@param path パスを表す文字...

Dir.home -> String | nil (8020.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 や 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 (8020.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 や Dir.home("root") は
File.expand_path("~") や File.expand_path("~root") と
ほぼ同じです。

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

@see File.expand_path...

File.absolute_path(file_name, dir_string=nil) -> String (8014.0)

file_name を絶対パスに変換した文字列を返します。

...はカレントディレクトリを基準とします。
dir_string を渡した場合はそのディレクトリを基準とします。

File.expand_path と異なり、 file_name 先頭が "~" である場合
それは展開されません。普通のディレクトリ名として処理されま...
...ME"] #=> "/home/matz"
p File.absolute_path("..") #=> "/home/matz/work"
p File.absolute_path("..", "/tmp") #=> "/"
p File.absolute_path("~") #=> "/home/matz/work/bar/~"
p File.absolute_path("~foo") #=> "/home/matz/work/bar/~foo"
//}

@see File.expand_path...
...OME"] #=> "/home/matz"
p File.absolute_path("..") #=> "/home/matz/work"
p File.absolute_path("..", "/tmp") #=> "/"
p File.absolute_path("~") #=> "/home/matz/work/bar/~"
p File.absolute_path("~foo") #=> "/home/matz/work/bar/~foo"
//}

@see File.expand_path...

Kernel.#require_relative(relative_feature) -> bool (8008.0)

現在のファイルからの相対パスで require します。

...現在のファイルからの相対パスで require します。

require File.expand_path(relative_feature, File.dirname(__FILE__))
とほぼ同じです。

Kernel.#eval などで文字列を評価した場合に、そこから
require_relative を呼出すと必ず失敗します。

@param r...

絞り込み条件を変える