種類
- 文書 (94)
- インスタンスメソッド (31)
- 関数 (13)
- 特異メソッド (10)
ライブラリ
- ビルトイン (41)
クラス
-
RubyVM
:: InstructionSequence (34) - TracePoint (7)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - Marshal フォーマット (12)
-
NEWS for Ruby 2
. 0 . 0 (12) -
NEWS for Ruby 2
. 6 . 0 (7) -
NEWS for Ruby 2
. 7 . 0 (6) -
NEWS for Ruby 3
. 0 . 0 (5) -
NEWS for Ruby 3
. 1 . 0 (4) -
instruction
_ sequence (7) -
load
_ from _ binary (10) -
rb
_ thread _ select (1) -
rb
_ thread _ wait _ for (12) -
ruby 1
. 6 feature (12) -
ruby 1
. 8 . 2 feature (12) -
ruby 1
. 9 feature (12) -
to
_ a (12)
検索結果
先頭5件
- RubyVM
:: InstructionSequence # eval -> object - TracePoint
# instruction _ sequence -> RubyVM :: InstructionSequence - RubyVM
:: InstructionSequence . load _ from _ binary(binary) -> RubyVM :: InstructionSequence - RubyVM
:: InstructionSequence # to _ a -> Array - int rb
_ thread _ select(int max , fd _ set *read , fd _ set *write , fd _ set *except , struct timeval *timeout)
-
RubyVM
:: InstructionSequence # eval -> object (21107.0) -
self の命令シーケンスを評価してその結果を返します。
...self の命令シーケンスを評価してその結果を返します。
RubyVM::InstructionSequence.compile("1 + 2").eval # => 3... -
TracePoint
# instruction _ sequence -> RubyVM :: InstructionSequence (6212.0) -
script_compiledイベント発生時にコンパイルされた RubyVM::InstructionSequenceインスタンスを返します。
...にコンパイルされた
RubyVM::InstructionSequenceインスタンスを返します。
//emlist[例][ruby]{
TracePoint.new(:script_compiled) do |tp|
p tp.instruction_sequence # => <RubyVM::InstructionSequence:block in <main>@(eval):1>
end.enable do
eval("puts 'hello'")
end
//}
@raise Runt... -
RubyVM
:: InstructionSequence . load _ from _ binary(binary) -> RubyVM :: InstructionSequence (3106.0) -
RubyVM::InstructionSequence#to_binaryにより作られたバイナリフォーマットの文字列からiseqのオブジェクトをロードします。
...RubyVM::InstructionSequence#to_binaryにより作られたバイナリフォーマットの文字列からiseqのオブジェクトをロードします。
このローダーは検証機構をもっておらず、壊れたり改変されたバイナリを読み込むと深刻な問題を引き起......りません。自分が変換したバイナリデータを使うべきです。
//emlist[例][ruby]{
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
binary = iseq.to_binary
RubyVM::InstructionSequence.load_from_binary(binary).eval # => 3
//}
@see RubyVM::InstructionSequence#to_binary... -
RubyVM
:: InstructionSequence # to _ a -> Array (3006.0) -
self の情報を 14 要素の配列にして返します。
...ます。
命令シーケンスを以下の情報で表します。
: magic
データフォーマットを示す文字列。常に
"YARVInstructionSequence/SimpleDataFormat"。
: major_version
命令シーケンスのメジャーバージョン。
: minor_version
命令シーケンス......シーケンスの 1 行目の行番号。
: type
命令シーケンスの種別。
:top、:method、:block、:class、:rescue、:ensure、:eval、:main、
:defined_guard のいずれか。
: locals
全ての引数名、ローカル変数名からなる Symbol の配列。
: args
引......とオペランドの配列の配列。
//emlist[例][ruby]{
require 'pp'
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
pp iseq.to_a
# ※ Ruby 2.5.0 での実行結果
# => ["YARVInstructionSequence/SimpleDataFormat",
# 2,
# 0,
# 1,
# {:arg_size=>0, :local_size=>2, :stack_max=>2},
#... -
int rb
_ thread _ select(int max , fd _ set *read , fd _ set *write , fd _ set *except , struct timeval *timeout) (200.0) -
この関数は deprecated です。rb_thread_fd_select を使用してください。
この関数は deprecated です。rb_thread_fd_select を使用してください。
Ruby のスレッドは実装のために内部で select(2) を使っているため、
拡張ライブラリ内で独自に select(2) を使った場合の動作は保証されません。
代わりにこの関数 rb_thread_select を使ってください。
引数の意味は select(2) と同じです。 -
void rb
_ thread _ wait _ for(struct timeval time) (200.0) -
time の長さの時間が経過するまでカレントスレッドを停止します。
time の長さの時間が経過するまでカレントスレッドを停止します。 -
ruby 1
. 6 feature (84.0) -
ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。
...が定義されていない場合例外 NameError を起こ
すようになりました。((<ruby-bugs-ja:PR#216>))
Object.new.instance_eval {
p remove_instance_variable :@foo
}
=> ruby 1.6.7 (2002-03-01) [i586-linux]
nil
=> -:2:in `remove_ins......ule_eval>))
((<Module/module_eval>)) のブロック内で定数やクラス変数のスコープが
変わることはなくなりました。((<ruby-dev:17876>))
class Foo
FOO = 1
@@foo = 1
end
FOO = 2
@@foo = 2
Foo.module_eval {......puts md
puts MD5.hexdigest("123")
: ((<Struct>))
フリーズされた構造体オブジェクトが変更できていました。また、$SAFE =
4 のときの変更を禁止するようにしました。((<ruby-talk:19167>))
cat = Struct.new("Cat", :name, :age, :life)
a = cat.... -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (72.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への変更点(まとめ)/サポートプラットフォームの追加>))
...なりました。
: ((<String#insert|String/insert>)) [new]
追加
(({str[n, 0] = other})) と同じ(ただし self を返す)
=== Struct
: ((<Struct/each_pair>)) [new]
追加。
=== Symbol
: ((<Symbol/Symbol.all_symbols>)) [new]
追加 ((<ruby-dev:12921>))
=== SystemCallError......w]
: ((<Hash#values_at|Hash/values_at>)) [new]
: ((<ENV/ENV.values_at>)) [new]
: ((<MatchData#values_at|MatchData/values_at>)) [new]
: ((<aStruct#values_at|Struct/values_at>)) [new]
ruby 1.6 の ((<indexes|Array/indexes>)) は、values_at というメソッド
名になりました(ruby 1.7 で......END__ は、スクリプトの終りとみなさなくな
りました。((<ruby-dev:17513>))
# p "
#__END__
#"
p eval(%Q(p "\n__END__\n"))
: ((<?<whitespace>|リテラル/数値リテラル>)) [parser] [change]
?スペース、?改行、?TAB 等はリテラル... -
Marshal フォーマット (42.0)
-
Marshal フォーマット フォーマットバージョン 4.8 を元に記述しています。
...roc)
//}
=== Struct
構造体クラスのインスタンスのダンプは 'S' で始まるデータ構造になります。
//emlist{
| 'S' | クラス名(Symbol) の dump | メンバの数(Fixnum形式) |
| メンバ名(Symbol) の dump | 値 | ... |
//}
//emlist[例][ruby]{
Struct.new("XXX",......:foo, :bar)
p Marshal.dump(Struct::XXX.new).unpack("x2 a ac a11 c aca3a aca3a")
# => ["S", ":", 16, "Struct::XXX", 7,
# ":", 8, "foo", "0",
# ":", 8, "bar", "0"]
//}
=== Class/Module (old format)
'M' で始まるデータ構造です。
//emlist{
| 'M' | 長さ(Fixnum形式) | モジュ......= 1
end
p Bar.instance_eval { @bar } # => 1
File.open('testfile', 'wb') do |f|
Marshal.dump(Bar, f)
end
# 別プログラム相当にするため remove_const
Object.send :remove_const, :Bar
module Bar
end
p bar = Marshal.load(File.binread('testfile'))
p bar.instance_eval { @bar }
# => nil
//}... -
NEWS for Ruby 2
. 6 . 0 (42.0) -
NEWS for Ruby 2.6.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...__ と __LINE__ の二要素配列として返します。
従来でも eval("[__FILE__, __LINE__]", binding) とすることでこれらの情報は得られましたが、
将来的に Kernel.#eval は binding のソースコード行を無視する変更を予定している......く
Enumerator::ArithmeticSequence クラスのインスタンスを返すようになりました。
* OpenStruct
* 変更されたメソッド
* OpenStruct#to_h はブロックを受け取りキーと値のペアを新しいキーと値に変換できるようになりまし......になりました。 4780
* Struct
* 変更されたメソッド
* Struct#to_h はブロックを受け取りキーと値のペアを新しいキーと値に変換できるようになりました。 15143
* 別名
* Struct#filter が Struct#select の別名として追加さ... -
NEWS for Ruby 3
. 0 . 0 (30.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...sent and has
a non-empty value, and the standard input and output are tty, the `--help`
option shows the help message via the pager designated by the value.
16754
=== `--backtrace-limit` option
The `--backtrace-limit` option limits the maximum length of a backtrace.
8661
== Core classes updates......ep(2)] # take each second element
# => ["data1", "data2", "data3"]
//}
* Binding
* Binding#eval when called with one argument will use `"(eval)"` for `__FILE__` and `1` for `__LINE__` in the evaluated code. 4352 17419
* ConditionVariable
* ConditionVariable#wait may now invoke the `bloc......t.
* OpenStruct
* Initialization is no longer lazy. 12136
* Builtin methods can now be overridden safely. 15409
* Implementation uses only methods ending with `!`.
* Ractor compatible.
* Improved support for YAML. 8382
* Use officially discouraged. Read OpenStruct@Caveats s...