223件ヒット
[1-100件を表示]
(0.050秒)
クラス
-
Encoding
:: Converter (11) - Exception (11)
- File (14)
-
File
:: Stat (11) - IO (55)
- Proc (11)
-
RubyVM
:: InstructionSequence (33) - Thread (22)
-
Thread
:: Backtrace :: Location (44) - TracePoint (11)
キーワード
- <=> (11)
-
absolute
_ path (22) -
backtrace
_ locations (22) - convpath (11)
- fdatasync (11)
- flush (11)
- inspect (22)
- reopen (33)
-
set
_ backtrace (11) -
source
_ location (11) -
to
_ path (7) -
to
_ s (11)
検索結果
先頭5件
-
File
# path -> String (18129.0) -
オープン時に使用したパスを文字列で返します。
...る場合です。
@raise IOError TMPFILE File::Constants::TMPFILEオプション付きで作成されている場合に発生します。
//emlist[例][ruby]{
File.open("testfile") {|f| f.path } #=> "testfile"
File.open("/tmp/../tmp/xxx", "w") {|f| f.path } #=> "....../tmp/../tmp/xxx"
File.open("/tmp", File::RDWR | File::TMPFILE){|f| f.path } # IOError: File is unnamed (TMPFILE?)
//}... -
RubyVM
:: InstructionSequence # path -> String (18128.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... -
Thread
:: Backtrace :: Location # path -> String (18122.0) -
self が表すフレームのファイル名を返します。
...self が表すフレームのファイル名を返します。
例: Thread::Backtrace::Location の例1を用いた例
//emlist[][ruby]{
loc = c(0..1).first
loc.path # => "caller_locations.rb"
//}
@see Thread::Backtrace::Location#absolute_path... -
TracePoint
# path -> String (18122.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
//}... -
Thread
:: Backtrace :: Location # absolute _ path -> String (6146.0) -
self が表すフレームの絶対パスを返します。
...][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end
Foo.new(0..2).locations.map do |call|
puts call.absolute_path
end
# => /path/to/foo.rb
# /path/to/foo.rb
# /path/to/foo.rb
//}
@see Thread::Backtrace::Location#path... -
File
# to _ path -> String (6129.0) -
オープン時に使用したパスを文字列で返します。
...る場合です。
@raise IOError TMPFILE File::Constants::TMPFILEオプション付きで作成されている場合に発生します。
//emlist[例][ruby]{
File.open("testfile") {|f| f.path } #=> "testfile"
File.open("/tmp/../tmp/xxx", "w") {|f| f.path } #=> "....../tmp/../tmp/xxx"
File.open("/tmp", File::RDWR | File::TMPFILE){|f| f.path } # IOError: File is unnamed (TMPFILE?)
//}... -
RubyVM
:: InstructionSequence # absolute _ path -> String | nil (6128.0) -
self が表す命令シーケンスの絶対パスを返します。
...:<compiled>@<compiled>>
iseq.absolute_path
# => nil
例2: RubyVM::InstructionSequence.compile_file を使用した場合
# /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... -
Encoding
:: Converter # convpath -> Array (6115.0) -
変換器が行う変換の経路を配列にして返します。
...ます。
@return 変換器が行う変換の経路の配列
//emlist[][ruby]{
ec = Encoding::Converter.new("ISo-8859-1", "EUC-JP", crlf_newline: true)
p ec.convpath
#=> [[#<Encoding:ISO-8859-1>, #<Encoding:UTF-8>],
# [#<Encoding:UTF-8>, #<Encoding:EUC-JP>],
# "crlf_newline"]
//}
@see Encod......ing::Converter.search_convpath... -
IO
# reopen(path) -> self (153.0) -
path で指定されたファイルにストリームを繋ぎ換えます。
...
path で指定されたファイルにストリームを繋ぎ換えます。
第二引数を省略したとき self のモードをそのまま引き継ぎます。
IO#pos, IO#lineno などはリセットされます。
@param path パスを表す文字列を指定します。
@param mode パ......スを開く際のモードを文字列で指定します。
@raise Errno::EXXX 失敗した場合に発生します。
//emlist[例][ruby]{
IO.write("testfile", "This is line one\nThis is line two\n")
f1 = File.new("testfile", "a+")
f2 = File.new("testfile")
f1.print("This is line three\n")
f2.re......adlines # => ["This is line one\n", "This is line two\n"]
f1.close
f2.reopen("testfile", "r") # => #<File:testfile>
f2.readlines # => ["This is line one\n", "This is line two\n", "This is line three\n"]
f2.close
//}
@see Kernel.#open... -
IO
# reopen(path , mode) -> self (153.0) -
path で指定されたファイルにストリームを繋ぎ換えます。
...
path で指定されたファイルにストリームを繋ぎ換えます。
第二引数を省略したとき self のモードをそのまま引き継ぎます。
IO#pos, IO#lineno などはリセットされます。
@param path パスを表す文字列を指定します。
@param mode パ......スを開く際のモードを文字列で指定します。
@raise Errno::EXXX 失敗した場合に発生します。
//emlist[例][ruby]{
IO.write("testfile", "This is line one\nThis is line two\n")
f1 = File.new("testfile", "a+")
f2 = File.new("testfile")
f1.print("This is line three\n")
f2.re......adlines # => ["This is line one\n", "This is line two\n"]
f1.close
f2.reopen("testfile", "r") # => #<File:testfile>
f2.readlines # => ["This is line one\n", "This is line two\n", "This is line three\n"]
f2.close
//}
@see Kernel.#open...