種類
- 特異メソッド (44)
- 文書 (33)
- ライブラリ (11)
- インスタンスメソッド (11)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) - DOSISH 対応 (11)
-
absolute
_ path (11) - home (22)
-
rdoc
/ generator / json _ index (11) -
ruby 1
. 6 feature (11)
検索結果
先頭5件
-
Dir
. home -> String | nil (21042.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 (21042.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
. expand _ path(path , default _ dir = & # 39; . & # 39;) -> String (18260.0) -
path を絶対パスに展開した文字列を返します。 path が相対パスであれば default_dir を基準にします。
...th が相対パスであれば default_dir を基準にします。
先頭の ~ はホームディレクトリ(環境変数 HOME が使われます)に、
~USER はそのユーザのホームディレクトリに展開されます。
//emlist[例][ruby]{
p Dir.getwd #=> "/home......e/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 パスを表す文字列を指定します。
@param default_dir path が相対......パスであれば default_dir を基準に展開されます。... -
Pathname
# expand _ path(default _ dir = & # 39; . & # 39;) -> Pathname (18248.0) -
Pathname.new(File.expand_path(self.to_s, *args)) と同じです。
...w(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... -
ruby 1
. 6 feature (138.0) -
ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。
...ラリロードの実行速度が低下するのだそ
うです) ((<ruby-dev:18145>))
: 2002-08-20 File.expand_path
Cygwin 1.3.x ((<ruby-bugs-ja:PR#299>))
p File.expand_path('file', 'c:/')
=> ruby 1.6.7 (2002-03-01) [i586-linux]
/tmp/c:/file
=> ruby 1.6.7......(2002-07-30) [i586-linux]
["a", "b", "c"]
: 2002-06-15 Dir.glob
リンクの切れたシンボリックリンクに対して、Dir.glob がマッチしません
でした。
File.symlink("foo", "bar")
p Dir.glob("bar")
=> ruby 1.6.7 (2002-03-01) [i586-linux]......)
net/protocol は削除される方向にあるようで、その準備時に
エンバグしたそうです。
: 2002-03-20 ((<File/File.expand_path>))
メモリの解放洩れがありました。((<ruby-bugs:PR#276>))
: 2002-03-18 文字列リテラル
漢字コードの扱いが #{... -
File
. absolute _ path(file _ name , dir _ string=nil) -> String (125.0) -
file_name を絶対パスに変換した文字列を返します。
...します。
dir_string を渡した場合はそのディレクトリを基準とします。
File.expand_path と異なり、 file_name 先頭が "~" である場合
それは展開されません。普通のディレクトリ名として処理されます。
//emlist[例][ruby]{
p Dir.getwd......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... -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (102.0) -
1.6.8から1.8.0への変更点(まとめ) * ((<1.6.8から1.8.0への変更点(まとめ)/インタプリタの変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたクラス/モジュール>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたメソッド>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加された定数>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張されたクラス/メソッド(互換性のある変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/変更されたクラス/メソッド(互換性のない変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/文法の変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/正規表現>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Marshal>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Windows 対応>)) * ((<1.6.8から1.8.0への変更点(まとめ)/廃止された(される予定の)機能>)) * ((<1.6.8から1.8.0への変更点(まとめ)/ライブラリ>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張ライブラリAPI>)) * ((<1.6.8から1.8.0への変更点(まとめ)/バグ修正>)) * ((<1.6.8から1.8.0への変更点(まとめ)/サポートプラットフォームの追加>))
...ッドでオブジェクトを
生成するようになりました。((<ruby-dev:14847>))
rb_define_alloc_func() も参照。
=== Dir
: ((<Dir#path|Dir/path>)) [new]
追加
=== ENV
: ((<ENV/ENV.clear>)) [new]
: ((<ENV/ENV.shift>)) [new]
: ((<ENV/ENV.invert>)) [new]
: ((<ENV/ENV......び出されるようになりました。
((<ruby-bugs-ja:342>))
=== Dir
: ((<Dir/Dir.glob>)) [compat]
Dir.glob に第2引数(マッチの挙動を変更するフラグ)を指定できるようにな
りました。Dir[] にはこのフラグは指定できません。
関連して定......o errno. [change]
: cygwin
cygwinでは常にバイナリモードになりました(((<ruby-dev:19583>)))
: ((<File/File.dirname>)) [CHANGE]
: ((<File/File.expand_path>)) [CHANGE]
: ((<File/File.join>)) [CHANGE]
DOSISHなプラットフォームでのドライブレター対応が強化さ... -
DOSISH 対応 (36.0)
-
DOSISH 対応 ruby version 1.7 では、DOSISH対応(DOS/Windows のパス名の扱いに対する変 更)が含まれています。(現在の)変更点を以下に示します。
...挙動について...
: File.dirname
パスセパレータとして従来の/に加えて\も認識するようになっています。
これに合わせて、マルチバイトで記述されたパス名への対応も行われています。
p File.dirname("C:\\foo\\bar")
=> ruby......6.4 (2001-06-04) [i586-mswin32]
"."
=> ruby 1.7.1 (2001-08-16) [i586-mswin32]
"C:\\foo"
p File.dirname("C:/foo")
p File.dirname("C:\\foo")
p File.dirname("C:foo")
=> ruby 1.6.4 (2001-06-04) [i586-mswin32]
"C:"
"."
"."
=> ruby 1.7.1 (2001......t
File.dirname と File.basename が変更されているので、File.split もそれに準じた
結果を返します。
: File.expand_path
ドライブレター対応に関して、下記のような案が提示されています。
Dir.chdir("D:/")
p File.expand_path("C:foo",... -
rdoc
/ generator / json _ index (12.0) -
他のジェネレータが生成する HTML で検索が行えるように、JSON の検索インデッ クスを生成するサブライブラリです。
...に使うために設計されています。:
class RDoc::Generator::Darkfish
def initialize options
# ...
@base_dir = Pathname.pwd.expand_path
@json_index = RDoc::Generator::JsonIndex.new self, options
end
def generate
# ...
@json_index.generate
e...