ライブラリ
- ビルトイン (324)
- csv (60)
-
irb
/ cmd / load (24) -
json
/ add / exception (12) -
net
/ ftp (20) -
net
/ http (204) - optparse (24)
- pathname (72)
- rake (72)
-
rake
/ packagetask (12) - shell (6)
-
shell
/ command-processor (6) -
shell
/ filter (6) - tempfile (24)
クラス
- CSV (48)
- Dir (144)
- Exception (24)
- File (12)
- IO (24)
-
IRB
:: ExtendCommand :: Load (12) -
IRB
:: ExtendCommand :: Source (12) - LoadError (12)
-
Net
:: FTP (20) -
Net
:: HTTP (156) -
Net
:: HTTPGenericRequest (24) -
Net
:: HTTPResponse (24) - OptionParser (24)
- Pathname (72)
-
Rake
:: Application (12) -
Rake
:: FileList (12) -
Rake
:: PackageTask (12) -
RubyVM
:: InstructionSequence (24) - Shell (6)
-
Shell
:: CommandProcessor (6) -
Shell
:: Filter (6) - Tempfile (24)
-
Thread
:: Backtrace :: Location (36) - TracePoint (24)
モジュール
- Kernel (36)
- Rake (36)
-
Rake
:: TaskManager (12)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - CSV (12)
-
NEWS for Ruby 2
. 1 . 0 (12) -
NEWS for Ruby 2
. 5 . 0 (8) -
NEWS for Ruby 2
. 7 . 0 (6) -
NEWS for Ruby 3
. 1 . 0 (4) - Options (12)
- Rubyの起動 (12)
- Ruby用語集 (12)
-
absolute
_ path (24) - application (12)
- application= (12)
- ascend (24)
-
body
_ stream (12) -
body
_ stream= (12) -
caller
_ locations (24) - cgi (12)
- chdir (48)
- create (24)
-
create
_ rule (12) - descend (24)
- execute (24)
- fdatasync (12)
- find (12)
- flush (12)
- get (24)
- get2 (24)
- inspect (24)
- irb (12)
- logger (12)
- mkdir (18)
- mlsd (20)
-
net
/ http (12) - new (24)
- open (96)
- opendir (24)
-
original
_ dir (24) -
package
_ dir _ path (12) - pathmap (12)
- post (24)
- post2 (24)
-
program
_ name (12) -
program
_ name= (12) -
rake
/ gempackagetask (12) - rdoc (12)
-
rdoc
/ generator / json _ index (12) -
read
_ body (24) -
request
_ get (24) -
request
_ post (24) -
require
_ relative (12) -
ruby 1
. 6 feature (12) -
ruby 1
. 8 . 3 feature (12) -
ruby 1
. 8 . 4 feature (12) -
ruby 1
. 8 . 5 feature (12) -
ruby 1
. 9 feature (12) - rubygems (12)
-
send
_ request (12) -
set
_ backtrace (12) -
test
/ unit (1) -
to
_ json (12) -
to
_ path (12) -
to
_ s (12) -
webrick
/ cgi (12) - セキュリティモデル (12)
- 変数と定数 (12)
検索結果
先頭5件
-
File
. path(filename) -> String (18195.0) -
指定されたファイル名を文字列で返します。filename が文字列でない場合は、to_path メソッドを呼びます。
...は、to_path メソッドを呼びます。
@param filename ファイル名を表す文字列か to_path メソッドが定義されたオブジェクトを指定します。
//emlist[例][ruby]{
require 'pathname'
class MyPath
def initialize(path)
@path = path
end
def to_path
File.......absolute_path(@path)
end
end
File.path("/dev/null") # => "/dev/null"
File.path(Pathname("/tmp")) # => "/tmp"
File.path(MyPath.new(".")) # => "/Users/user/projects/txt"
//}... -
RubyVM
:: InstructionSequence # path -> String (18125.0) -
self が表す命令シーケンスの相対パスを返します。
...ompiled>@<compiled>>
iseq.path
# => "<compiled>"
例2: RubyVM::InstructionSequence.compile_file を使用した場合
# /tmp/method.rb
def hello
puts "hello, world"
end
# irb
> iseq = RubyVM::InstructionSequence.compile_file('method.rb')
> iseq.path # => "method.rb"
@see Ruby......VM::InstructionSequence#absolute_path... -
TracePoint
# path -> String (18125.0) -
イベントが発生したファイルのパスを返します。
...トが発生したファイルのパスを返します。
@raise RuntimeError イベントフックの外側で実行した場合に発生します。
//emlist[例][ruby]{
def foo(ret)
ret
end
trace = TracePoint.new(:call) do |tp|
p tp.path # => "/path/to/test.rb"
end
trace.enable
foo 1
//}... -
Dir
# path -> String (18120.0) -
オープンしているディレクトリのパス名を文字列で返します。
...オープンしているディレクトリのパス名を文字列で返します。
//emlist[例][ruby]{
Dir.open("..") do |d|
d.path # => ".."
d.to_path # => ".."
end
//}... -
LoadError
# path -> String | nil (18113.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
# ascend {|pathname| . . . } -> nil (9260.0) -
self のパス名から親方向に辿っていったときの各パス名を新しい Pathname オ ブジェクトとして生成し、ブロックへの引数として渡して実行します。 ブロックを省略した場合は Enumerator を返します。
... Pathname オ
ブジェクトとして生成し、ブロックへの引数として渡して実行します。
ブロックを省略した場合は Enumerator を返します。
//emlist[例][ruby]{
require 'pathname'
Pathname.new('/path/to/some/file.rb').ascend {|v| p v}
# => #<Pathname:/path/to/......ome/file.rb>
# #<Pathname:/path/to/some>
# #<Pathname:/path/to>
# #<Pathname:/path>
# #<Pathname:/>
Pathname.new('path/to/some/file.rb').ascend {|v| p v}
# => #<Pathname:path/to/some/file.rb>
# #<Pathname:path/to/some>
# #<Pathname:path/to>
# #<Pathname:path>
//}
ファイル... -
Pathname
# descend {|pathname| . . . } -> nil (9260.0) -
self のパス名の親から子供へと辿っていったときの各パス名を新しい Pathname オブジェクトとして生成し、ブロックへの引数として渡して実行しま す。 ブロックを省略した場合は Enumerator を返します。
...しい
Pathname オブジェクトとして生成し、ブロックへの引数として渡して実行しま
す。
ブロックを省略した場合は Enumerator を返します。
//emlist[例][ruby]{
require 'pathname'
Pathname.new('/path/to/some/file.rb').descend {|v| p v}
# => #<Pathname:/>......# #<Pathname:/path>
# #<Pathname:/path/to>
# #<Pathname:/path/to/some>
# #<Pathname:/path/to/some/file.rb>
Pathname.new('path/to/some/file.rb').descend {|v| p v}
# => #<Pathname:path>
# #<Pathname:path/to>
# #<Pathname:path/to/some>
# #<Pathname:path/to/some/file.rb>
//}
フ... -
Pathname
# ascend -> Enumerator (9160.0) -
self のパス名から親方向に辿っていったときの各パス名を新しい Pathname オ ブジェクトとして生成し、ブロックへの引数として渡して実行します。 ブロックを省略した場合は Enumerator を返します。
... Pathname オ
ブジェクトとして生成し、ブロックへの引数として渡して実行します。
ブロックを省略した場合は Enumerator を返します。
//emlist[例][ruby]{
require 'pathname'
Pathname.new('/path/to/some/file.rb').ascend {|v| p v}
# => #<Pathname:/path/to/......ome/file.rb>
# #<Pathname:/path/to/some>
# #<Pathname:/path/to>
# #<Pathname:/path>
# #<Pathname:/>
Pathname.new('path/to/some/file.rb').ascend {|v| p v}
# => #<Pathname:path/to/some/file.rb>
# #<Pathname:path/to/some>
# #<Pathname:path/to>
# #<Pathname:path>
//}
ファイル... -
Pathname
# descend -> Enumerator (9160.0) -
self のパス名の親から子供へと辿っていったときの各パス名を新しい Pathname オブジェクトとして生成し、ブロックへの引数として渡して実行しま す。 ブロックを省略した場合は Enumerator を返します。
...しい
Pathname オブジェクトとして生成し、ブロックへの引数として渡して実行しま
す。
ブロックを省略した場合は Enumerator を返します。
//emlist[例][ruby]{
require 'pathname'
Pathname.new('/path/to/some/file.rb').descend {|v| p v}
# => #<Pathname:/>......# #<Pathname:/path>
# #<Pathname:/path/to>
# #<Pathname:/path/to/some>
# #<Pathname:/path/to/some/file.rb>
Pathname.new('path/to/some/file.rb').descend {|v| p v}
# => #<Pathname:path>
# #<Pathname:path/to>
# #<Pathname:path/to/some>
# #<Pathname:path/to/some/file.rb>
//}
フ...