543件ヒット
[501-543件を表示]
(0.128秒)
ライブラリ
クラス
- Binding (78)
- ERB (33)
-
IRB
:: Frame (55) - Object (11)
- Proc (11)
-
RubyVM
:: InstructionSequence (11) - Socket (11)
- Thread (38)
- TracePoint (22)
- Tracer (33)
- XMP (11)
モジュール
- Kernel (33)
- ObjectSpace (33)
-
Socket
:: Constants (11)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) - Binding (11)
- Context (11)
-
IP
_ FREEBIND (22) -
NEWS for Ruby 2
. 1 . 0 (11) -
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) -
TOPLEVEL
_ BINDING (11) -
add
_ filter (22) - backtrace (11)
- bottom (22)
-
count
_ tdata _ objects (11) -
define
_ finalizer (22) - eval (22)
- irb (19)
-
irb
/ xmp (11) -
local
_ variable _ defined? (11) -
local
_ variable _ get (11) -
local
_ variable _ set (11) -
local
_ variables (10) - new (22)
- of (11)
-
proc
_ binding (11) -
rb
_ f _ binding (11) -
rb
_ obj _ is _ block (11) - receiver (10)
-
report
_ on _ exception (8) -
report
_ on _ exception= (8) - result (11)
-
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 4 feature (11) -
ruby 1
. 9 feature (11) - run (11)
- self (11)
-
set
_ trace _ func (11) -
source
_ location (6) - top (22)
-
trace
_ func (22) - tracer (11)
- xmp (11)
検索結果
先頭5件
-
ObjectSpace
. # count _ tdata _ objects(result _ hash = nil) -> Hash (106.0) -
T_DATA の種類ごとにオブジェクトの数を格納したハッシュを返します。
...ます。
@raise TypeError result_hash にハッシュ以外を指定した時に発生します。
本メソッドは普通の Ruby プログラマ向けのメソッドではありません。パフォー
マンスに興味のある C Ruby の開発者向けのものです。
//emlist[例][ruby]......_tdata_objects
# => {RubyVM::InstructionSequence=>504, :parser=>5, :barrier=>6,
# :mutex=>6, Proc=>60, RubyVM::Env=>57, Mutex=>1, Encoding=>99,
# ThreadGroup=>1, Binding=>1, Thread=>1, RubyVM=>1, :iseq=>1,
# Random=>1, ARGF.class=>1, Data=>1, :autoload=>3, Time=>2}
//}
現在のバー... -
Thread
# backtrace -> [String] | nil (106.0) -
スレッドの現在のバックトレースを返します。
...nil を返します。
//emlist[例][ruby]{
class C1
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
//}... -
NEWS for Ruby 2
. 1 . 0 (54.0) -
NEWS for Ruby 2.1.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...報があるため短いです。
十分な情報と共に書かれた全ての変更のリストは ChangeLog ファイルか bugs.ruby-lang.org の issue を参照してください。
== 2.0.0 以降の変更
=== 言語仕様の変更
* キーワード引数のデフォルト値が省略可......尾に'r','i','ri'という接尾辞を付けられるようになりました
//emlist{
# r を付けると有理数になる
42r # => Rational(42, 1)
3.14 # => 3.14.rationalize
6.022e+23r # 指数形式と一緒には使えない
# i を付けると虚数単位 i を掛けた......3.14ri # => Complex(0, 3.14r)
//}
* def によるメソッド定義式は nil の代わりにメソッド名をシンボルで返します
=== 組み込みクラスの更新
* Array
* 追加: Array#to_h キーと値のペアの配列をハッシュに変換します。
* Binding
*... -
tracer (42.0)
-
実行トレース出力をとる機能を提供します。
...以下のようにコマンドラインから Kernel.#require する方法です。
hoge.rb の実行をすべてトレース出力します。
ruby -rtracer hoge.rb
もうひとつはソースからrequireする方法です。
require 'tracer'
とした後
Tracer.on
によりトレー......動作します。
require 'tracer'
class Hoge
def Hoge.fuga(i)
"fuga #{i}"
end
end
Tracer.add_filter {|event, file, line, id, binding, klass|
event =~ /line/ and klass.to_s =~ /hoge/i
}
Tracer.on
for i in 0..3
puts Hoge.fuga(i) if i % 3 == 0
end
Tracer.off... -
NEWS for Ruby 3
. 0 . 0 (18.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...positional arguments.
Code that resulted in deprecation warnings in Ruby 2.7 will now
result in ArgumentError or different behavior. 14183
* Procs accepting a single rest argument and keywords are no longer
subject to autosplatting. This now matches the behavior of Procs
accepting......single rest argument and no keywords.
16166
//emlist[][ruby]{
pr = proc{|*a, **kw| [a, kw]}
pr.call([1])
# 2.7 => [[1], {}]
# 3.0 => [[[1]], {}]
pr.call([1, {a: 1}])
# 2.7 => [[1], {:a=>1}] # and deprecation warning
# 3.0 => a=>1}, {}]
//}
* Arguments forwarding (`...`) now supports leadin......ake_while
* Array#uniq
* Array#*
* Can be sliced with Enumerator::ArithmeticSequence
//emlist[][ruby]{
dirty_data = ['--', 'data1', '--', 'data2', '--', 'data3']
dirty_data[(1..).step(2)] # take each second element
# => ["data1", "data2", "data3"]
//}
* Binding
* Binding#eval... -
NEWS for Ruby 2
. 7 . 0 (12.0) -
NEWS for Ruby 2.7.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...ルか bugs.ruby-lang.org の issue を参照してください。
== 2.6.0 以降の変更
=== 言語仕様の変更
==== パターンマッチ
* パターンマッチが実験的機能として導入されました。 14912
//emlist[][ruby]{
case [0, [1, 2, 3]]
in [a, [b, *c]]
p a #=> 0......nd
//}
//emlist[][ruby]{
case {a: 0, b: 1}
in {a: 0, x: 1}
:unreachable
in {a: 0, b: var}
p var #=> 1
end
//}
//emlist[][ruby]{
case -1
in 0 then :unreachable
in 1 then :unreachable
end #=> NoMatchingPatternError
//}
//emlist{
json = <<END
{
"name": "Alice",
"age": 30,
"children": [{ "n......うになりました。
* IRB
* Pry gem に着想を得て、Binding#irbのソース表示、REPLの入力、
いくつかのコアクラスオブジェクトのinspect出力に
シンタックスハイライトが導入されました。
* Relineによって提供される...