ライブラリ
- ビルトイン (103)
- etc (11)
-
irb
/ cmd / load (22) - logger (11)
- mkmf (55)
-
net
/ ftp (27) -
net
/ http (407) -
net
/ pop (11) - openssl (22)
- pathname (269)
- rake (22)
-
rexml
/ document (77) -
rubygems
/ commands / unpack _ command (11) -
rubygems
/ gem _ path _ searcher (11) -
rubygems
/ remote _ fetcher (22) -
rubygems
/ source _ info _ cache (11) - shell (18)
-
shell
/ command-processor (6) -
shell
/ filter (6) - tempfile (55)
- uri (22)
-
webrick
/ httpauth / htdigest (11) -
webrick
/ httpauth / htgroup (11)
クラス
- Exception (11)
-
File
:: Stat (22) -
Gem
:: Commands :: UnpackCommand (11) -
Gem
:: GemPathSearcher (11) -
Gem
:: RemoteFetcher (22) -
Gem
:: SourceInfoCache (11) - IO (15)
-
IRB
:: ExtendCommand :: Load (11) -
IRB
:: ExtendCommand :: Source (11) - LoadError (11)
- Logger (11)
-
Net
:: FTP (27) -
Net
:: HTTP (385) -
Net
:: HTTPResponse (22) -
Net
:: POP3 (11) -
OpenSSL
:: SSL :: SSLContext (11) -
OpenSSL
:: X509 :: Store (11) - Pathname (269)
- Proc (11)
-
RDoc
:: Options (11) -
REXML
:: Element (33) -
REXML
:: Elements (44) -
Rake
:: FileList (11) -
RubyVM
:: InstructionSequence (22) - Shell (18)
-
Shell
:: CommandProcessor (6) -
Shell
:: Filter (6) - String (11)
- Tempfile (55)
- Thread (22)
-
URI
:: Generic (11) -
URI
:: HTTP (11) -
WEBrick
:: HTTPAuth :: Htdigest (11) -
WEBrick
:: HTTPAuth :: Htgroup (11)
モジュール
- Kernel (55)
キーワード
- <=> (22)
-
absolute
_ path (11) - ascend (22)
-
backtrace
_ locations (22) - binread (11)
- binwrite (11)
-
ca
_ path (22) - cleanpath (11)
- close (11)
- close! (11)
- collect (11)
- copy (11)
-
create
_ makefile (11) - delete (22)
- descend (22)
-
dir
_ config (11) - each (11)
-
each
_ element (11) -
each
_ entry (13) -
each
_ filename (11) -
each
_ line (22) -
enable
_ ssl (11) - execute (22)
-
fetch
_ path (11) - find (33)
-
find
_ executable (11) -
find
_ library (22) - flush (22)
- foreach (18)
- formatter (11)
- get (22)
- get2 (22)
-
get
_ path (11) -
get
_ text (11) - glob (14)
- head (11)
- head2 (22)
- inject (11)
- lock (11)
- mkcol (11)
- mkpath (11)
- mlsd (18)
- mlst (9)
- move (11)
-
open
_ uri _ or _ path (11) - opendir (22)
-
page
_ dir (11) - patch (22)
- pathconf (11)
- pathmap (22)
- post (22)
- post2 (22)
- proppatch (11)
- pushd (6)
- pushdir (6)
- put (11)
- put2 (22)
- read (11)
-
read
_ body (22) - realdirpath (11)
- realpath (22)
-
request
_ get (22) -
request
_ head (22) -
request
_ post (22) -
request
_ put (22) -
request
_ uri (11) - rmtree (11)
-
send
_ request (11) -
set
_ backtrace (11) -
set
_ default _ paths (11) - size? (11)
-
source
_ location (11) - text (11)
-
to
_ a (22) -
to
_ path (2) - trace (11)
-
try
_ file (11) - unlink (11)
- unlock (11)
- write (11)
検索結果
先頭5件
-
URI
:: Generic # path -> String | nil (18371.0) -
自身の path を文字列で返します。設定されていない場合は nil を返します。
...の path を文字列で返します。設定されていない場合は nil を返します。
require 'uri'
p URI.parse('http://example.com/hoge').path #=> "/hoge"
p URI.parse('http://example.com').path #=> ""
p URI.parse('mailto:nospam@localhost').path #=> nil
p......URI('ftp://example.com/foo').path #=> 'foo'
p URI('ftp://example.com/%2Ffoo').path #=> '/foo'... -
IO
# path -> String | nil (18345.0) -
IO に関連付けられたパスを返します。IO がパスに関連付けられていない場合は nil を返します。
...ていない場合は nil を返します。
このメソッドが返すパスがファイルシステム上に存在することは保証されていません。
//emlist[例][ruby]{
p STDIN.path # => "<STDIN>"
p IO.new(IO.sysopen("/")).path # => "/"......p IO.new(IO.sysopen("/"), path: "foo").path # => "foo"
//}... -
Tempfile
# path -> String | nil (18327.0) -
テンポラリファイルのパス名を返します。
...テンポラリファイルのパス名を返します。
Tempfile#close! を実行後だった場合にはnilを返します。
require "tempfile"
tf = Tempfile.new("hoo")
p tf.path # => "/tmp/hoo.10596.0"
tf.close!
p tf.path # => nil... -
LoadError
# path -> String | nil (18315.0) -
Kernel.#require や Kernel.#load に失敗したパスを返します。
...Kernel.#require や Kernel.#load に失敗したパスを返します。
begin
require 'this/file/does/not/exist'
rescue LoadError => e
e.path # => 'this/file/does/not/exist'
end
パスが定まらない場合は nil を返します。... -
Pathname
# realpath(basedir = nil) -> Pathname (9450.0) -
余計な "."、".." や "/" を取り除いた新しい Pathname オブジェクトを返します。
...余計な "."、".." や "/" を取り除いた新しい Pathname オブジェクトを返します。
また、ファイルシステムをアクセスし、実際に存在するパスを返します。
シンボリックリンクも解決されます。
self が指すパスが存在しない場......uire 'pathname'
Dir.rmdir("/tmp/foo") rescue nil
File.unlink("/tmp/bar/foo") rescue nil
Dir.rmdir("/tmp/bar") rescue nil
Dir.mkdir("/tmp/foo")
Dir.mkdir("/tmp/bar")
File.symlink("../foo", "/tmp/bar/foo")
path = Pathname.new("bar/././//foo/../bar")
Dir.chdir("/tmp")
p path.realpath
# =......> ruby 1.8.0 (2003-10-10) [i586-linux]
# #<Pathname:/tmp/bar>
//}
@see Pathname#realdirpath, File.realpath... -
Pathname
# realdirpath(basedir = nil) -> Pathname (9432.0) -
Pathname#realpath とほぼ同じで、最後のコンポーネントは実際に 存在しなくてもエラーになりません。
...
Pathname#realpath とほぼ同じで、最後のコンポーネントは実際に
存在しなくてもエラーになりません。
@param basedir ベースディレクトリを指定します。省略するとカレントディレクトリになります。
//emlist[例][ruby]{
require "pathna......me"
path = Pathname("/not_exist")
path.realdirpath # => #<Pathname:/not_exist>
path.realpath # => Errno::ENOENT
# 最後ではないコンポーネント(/not_exist_1)も存在しないのでエラーになる。
path = Pathname("/not_exist_1/not_exist_2")
path.realdirpath # => Errno::ENOENT......//}
@see Pathname#realpath... -
Pathname
# cleanpath(consider _ symlink = false) -> Pathname (9355.0) -
余計な "."、".." や "/" を取り除いた新しい Pathname オブジェクトを返します。
...余計な "."、".." や "/" を取り除いた新しい Pathname オブジェクトを返します。
cleanpath は、実際にファイルシステムを参照することなく、文字列操作
だけで処理を行います。
@param consider_symlink 真ならパス要素にシンボリック......uby]{
require "pathname"
path = Pathname.new("//.././../")
path # => #<Pathname://.././../>
path.cleanpath # => #<Pathname:/>
require 'pathname'
Dir.rmdir("/tmp/foo") rescue nil
File.unlink("/tmp/bar/foo") rescue nil
Dir.rmdir("/tmp/bar") rescue nil
Dir.mkdir("/tm......p/foo")
Dir.mkdir("/tmp/bar")
File.symlink("../foo", "/tmp/bar/foo")
path = Pathname.new("bar/././//foo/../bar")
Dir.chdir("/tmp")
path.cleanpath # => #<Pathname:bar/bar>
path.cleanpath(true) # => #<Pathname:bar/foo/../bar>
//}... -
Pathname
# realpath -> Pathname (9350.0) -
余計な "."、".." や "/" を取り除いた新しい Pathname オブジェクトを返します。
...余計な "."、".." や "/" を取り除いた新しい Pathname オブジェクトを返します。
また、ファイルシステムをアクセスし、実際に存在するパスを返します。
シンボリックリンクも解決されます。
self が指すパスが存在しない場......uire 'pathname'
Dir.rmdir("/tmp/foo") rescue nil
File.unlink("/tmp/bar/foo") rescue nil
Dir.rmdir("/tmp/bar") rescue nil
Dir.mkdir("/tmp/foo")
Dir.mkdir("/tmp/bar")
File.symlink("../foo", "/tmp/bar/foo")
path = Pathname.new("bar/././//foo/../bar")
Dir.chdir("/tmp")
p path.realpath
# =......> ruby 1.8.0 (2003-10-10) [i586-linux]
# #<Pathname:/tmp/bar>
//}
@see Pathname#realdirpath, File.realpath... -
Pathname
# mkpath -> nil (9302.0) -
FileUtils.mkpath(self.to_s) と同じです。
...FileUtils.mkpath(self.to_s) と同じです。
@see FileUtils.#mkpath... -
IO
# to _ path -> String | nil (6345.0) -
IO に関連付けられたパスを返します。IO がパスに関連付けられていない場合は nil を返します。
...ていない場合は nil を返します。
このメソッドが返すパスがファイルシステム上に存在することは保証されていません。
//emlist[例][ruby]{
p STDIN.path # => "<STDIN>"
p IO.new(IO.sysopen("/")).path # => "/"......p IO.new(IO.sysopen("/"), path: "foo").path # => "foo"
//}... -
RubyVM
:: InstructionSequence # absolute _ path -> String | nil (6333.0) -
self が表す命令シーケンスの絶対パスを返します。
...f を文字列から作成していた場合は nil を返します。
例1:irb で実行した場合
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.absolute_path
# => nil
例2: RubyVM::InstructionSequence.compile_fi......le を使用した場合
# /tmp/method.rb
def hello
puts "hello, world"
end
# irb
> iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.absolute_path # => "/tmp/method.rb"
@see RubyVM::InstructionSequence#path...