るりまサーチ

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

別のキーワード

  1. fiddle ruby_free
  2. rbconfig ruby
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

クラス

モジュール

オブジェクト

キーワード

検索結果

<< 1 2 > >>

Dir.home -> String | nil (18139.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 (18139.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.dirname(filename, level=1) -> String (49.0)

filename の一番後ろのスラッシュより前を文 字列として返します。スラッシュを含まないファイル名に対しては "."(カレントディレクトリ)を返します。

...レントディレクトリ)を返します。

//emlist[例][ruby]{
p File.dirname("dir/file.ext") # => "dir"
p File.dirname("file.ext") # => "."
//}

File.dirname の動作は dirname(3)
に従います。
//emlist[例][ruby]{
p File.dirname("foo/bar/") # => "foo"
p File.dirname("fo...
...最後のlevel個を取り除いた文字列を返します。

//emlist[levelを指定する例][ruby]{
File.dirname("/home/gumby/work/ruby.rb", 2) # => "/home/gumby"
File.dirname("/home/gumby/work/ruby.rb", 4) # => "/"
//}

@param filename ファイル名を表す文字列を指定します。
@pa...

File.expand_path(path, default_dir = &#39;.&#39;) -> String (49.0)

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

...変数 HOME が使われます)に、
~USER はそのユーザのホームディレクトリに展開されます。

//emlist[例][ruby]{
p Dir.getwd #=> "/home/matz/work/foo"
p ENV["HOME"] #=> "/home/matz"
p File.expand_path("..") #=> "/home/matz/wor...
...k"
p File.expand_path("..", "/tmp") #=> "/"
p File.expand_path("~") #=> "/home/matz"
p File.expand_path("~foo") #=> "/home/foo"
//}

@param path パスを表す文字列を指定します。

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

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

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

...

//emlist[例][ruby]{
p Dir.getwd #=> "/home/matz/work/bar"
p ENV["HOME"] #=> "/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...

絞り込み条件を変える

File.realpath(pathname, basedir = nil) -> String (31.0)

与えられた pathname に対応する絶対パスを返します。

...しない場合に発生します。

//emlist[例][ruby]{
ENV["HOME"] # => "/home/matz"
File.symlink("testfile", "testlink")
File.realpath("testfile") # => "/home/matz/testfile"
File.realpath("testlink") # => "/home/matz/testfile"
File.realpath("..", "/tmp") # =>...

ENV.except(*keys) -> Hash (19.0)

引数で指定された以外のキーとその値だけを含む Hash を返します。

...引数で指定された以外のキーとその値だけを含む Hash を返します。

//emlist[][ruby]{
ENV #=> {"LANG"=>"en_US.UTF-8", "TERM"=>"xterm-256color", "HOME"=>"/Users/rhc"}
ENV.except("TERM","HOME") #=> {"LANG"=>"en_US.UTF-8"}
//}

@see Hash#except, ENV.slice...

Pathname.getwd -> Pathname (19.0)

カレントディレクトリを元に Pathname オブジェクトを生成します。 Pathname.new(Dir.getwd) と同じです。

...カレントディレクトリを元に Pathname オブジェクトを生成します。
Pathname.new(Dir.getwd) と同じです。

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

Pathname.getwd #=> #<Pathname:/home/zzak/projects/ruby>
//}

@see Dir.getwd...

Pathname.pwd -> Pathname (19.0)

カレントディレクトリを元に Pathname オブジェクトを生成します。 Pathname.new(Dir.getwd) と同じです。

...カレントディレクトリを元に Pathname オブジェクトを生成します。
Pathname.new(Dir.getwd) と同じです。

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

Pathname.getwd #=> #<Pathname:/home/zzak/projects/ruby>
//}

@see Dir.getwd...

RbConfig.expand(val, config = CONFIG) -> String (19.0)

与えられたパスを展開します。

...与えられたパスを展開します。

RbConfig.expand("$(bindir)") # => /home/foobar/all-ruby/ruby19x/bin

@param val 展開したい変数名を Makefile に書く形式で指定します。

@param config 変数展開に使用する設定を Hash で指定します。

@see RbConfig::MA...

絞り込み条件を変える

<< 1 2 > >>