172件ヒット
[1-100件を表示]
(0.038秒)
別のキーワード
種類
- インスタンスメソッド (117)
- 特異メソッド (41)
- 変数 (14)
クラス
- Binding (8)
-
RubyVM
:: InstructionSequence (77) - Thread (54)
- TracePoint (11)
モジュール
- Kernel (14)
-
RubyVM
:: AbstractSyntaxTree (8)
キーワード
-
$ -K (7) -
$ KCODE (7) -
absolute
_ path (11) - backtrace (11)
-
base
_ label (11) -
compile
_ file (11) -
first
_ lineno (11) - inspect (11)
- label (11)
- name= (9)
- new (11)
- of (19)
- path (11)
-
report
_ on _ exception (8) -
report
_ on _ exception= (8) -
to
_ s (7)
検索結果
先頭5件
-
Binding
# irb -> object (18121.0) -
REPLのセッションを開始します。
...REPLのセッションを開始します。
2.5.0 からは require 'irb' せずに直接 binding.irb を呼び出しても使えるようになりました。
@see irb... -
RubyVM
:: InstructionSequence . of(body) -> RubyVM :: InstructionSequence (32.0) -
引数 body で指定した Proc、Method オブジェクトを元に RubyVM::InstructionSequence オブジェクトを作成して返します。
...m body Proc、Method オブジェクトを指定します。
例1:irb で実行した場合
# proc
> p = proc { num = 1 + 2 }
> RubyVM::InstructionSequence.of(p)
> # => <RubyVM::InstructionSequence:block in irb_binding@(irb)>
# method
> def foo(bar); puts bar; end
> RubyVM::Instruct......hod(:foo))
> # => <RubyVM::InstructionSequence:foo@(irb)>
例2: RubyVM::InstructionSequence.compile_file を使用した場合
# /tmp/iseq_of.rb
def hello
puts "hello, world"
end
$a_global_proc = proc { str = 'a' + 'b' }
# irb
> require '/tmp/iseq_of.rb'
# hello メソッド... -
Thread
# backtrace -> [String] | nil (32.0) -
スレッドの現在のバックトレースを返します。
...def m1
sleep 5
end
def m2
m1
end
end
th = Thread.new {C1.new.m2; Thread.stop}
th.backtrace
# => [
# [0] "(irb):3:in `sleep'",
# [1] "(irb):3:in `m1'",
# [2] "(irb):6:in `m2'",
# [3] "(irb):10:in `block in irb_binding'"
# ]
th.kill
th.backtrace # => nil
//}... -
Thread
# report _ on _ exception -> bool (32.0) -
真の場合、そのスレッドが例外によって終了した時に、その内容を $stderr に報告します。
...> true
a.run
# => #<Thread:0x00007fc3f48c7908@(irb):1 run> terminated with exception (report_on_exception is true):
# Traceback (most recent call last):
# (irb):1:in `block in irb_binding': unhandled exception
# #<Thread:0x00007fc3f48c7908@(irb):1 dead>
b = Thread.new{ Thread.stop; raise }......b.report_on_exception = false
b.run # => #<Thread:0x00007fc3f48aefc0@(irb):4 dead>
//}
@see Thread.report_on_exception... -
Thread
# report _ on _ exception=(newstate) (32.0) -
真の場合、そのスレッドが例外によって終了した時に、その内容を $stderr に報告します。
...> true
a.run
# => #<Thread:0x00007fc3f48c7908@(irb):1 run> terminated with exception (report_on_exception is true):
# Traceback (most recent call last):
# (irb):1:in `block in irb_binding': unhandled exception
# #<Thread:0x00007fc3f48c7908@(irb):1 dead>
b = Thread.new{ Thread.stop; raise }......b.report_on_exception = false
b.run # => #<Thread:0x00007fc3f48aefc0@(irb):4 dead>
//}
@see Thread.report_on_exception... -
Kernel
$ $ -K -> nil (14.0) -
この特殊変数は何の影響も持たなくなりました。
...たなくなりました。
値を代入しても無視され、参照すると常に nil です。
>> $KCODE = true
(irb):1: warning: variable $KCODE is no longer effective; ignored
=> true
>> $KCODE
(irb):2: warning: variable $KCODE is no longer effective
=> nil
@see spec/rubycmd... -
Kernel
$ $ KCODE -> nil (14.0) -
この特殊変数は何の影響も持たなくなりました。
...たなくなりました。
値を代入しても無視され、参照すると常に nil です。
>> $KCODE = true
(irb):1: warning: variable $KCODE is no longer effective; ignored
=> true
>> $KCODE
(irb):2: warning: variable $KCODE is no longer effective
=> nil
@see spec/rubycmd... -
RubyVM
:: InstructionSequence # absolute _ path -> String | nil (14.0) -
self が表す命令シーケンスの絶対パスを返します。
...elf が表す命令シーケンスの絶対パスを返します。
self を文字列から作成していた場合は nil を返します。
例1:irb で実行した場合
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
ise......# => 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::InstructionSequenc... -
RubyVM
:: InstructionSequence # base _ label -> String (14.0) -
self が表す命令シーケンスの基本ラベルを返します。
...self が表す命令シーケンスの基本ラベルを返します。
例1:irb で実行した場合
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.base_label
# => "<compiled>"
例2: RubyVM::InstructionSequence.co......mpile_file を使用した場合
# /tmp/method.rb
def hello
puts "hello, world"
end
# irb
> iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.base_label # => "<main>"
例3:
# /tmp/method2.rb
def hello
puts "hello, world"
end
RubyVM::Instruction... -
RubyVM
:: InstructionSequence # label -> String (14.0) -
self が表す命令シーケンスのラベルを返します。通常、メソッド名、クラス名、 モジュール名などで構成されます。
...。
トップレベルでは "<main>" を返します。self を文字列から作成していた場合
は "<compiled>" を返します。
例1:irb で実行した場合
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.......<compiled>"
例2: RubyVM::InstructionSequence.compile_file を使用した場合
# /tmp/method.rb
def hello
puts "hello, world"
end
# irb
> iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.label # => "<main>"
例3:
# /tmp/method2.rb
def hello
puts... -
RubyVM
:: InstructionSequence # path -> String (14.0) -
self が表す命令シーケンスの相対パスを返します。
...self の作成時に指定した文字列を返します。self を文字列から作成していた
場合は "<compiled>" を返します。
例1:irb で実行した場合
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
ise......"<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 RubyVM::InstructionSequence#absolute_path...