種類
- 特異メソッド (44)
- 定数 (33)
- 文書 (15)
- インスタンスメソッド (11)
ライブラリ
- ビルトイン (22)
- ripper (33)
-
ripper
/ filter (11) -
ripper
/ lexer (11) -
ripper
/ sexp (11)
クラス
- Ripper (55)
-
Ripper
:: Filter (11) - TracePoint (22)
キーワード
-
NEWS for Ruby 3
. 0 . 0 (4) -
PARSER
_ EVENTS (11) -
SCANNER
_ EVENTS (11) - new (11)
-
on
_ XXX (11) -
ruby 1
. 8 . 4 feature (11) - sexp (11)
- slice (11)
- trace (11)
検索結果
先頭5件
-
Ripper
:: EVENTS -> [Symbol] (21201.0) -
ripper の扱う全てのイベント ID (シンボル) のリストを返します。
...ripper の扱う全てのイベント ID (シンボル) のリストを返します。... -
Ripper
:: PARSER _ EVENTS -> [Symbol] (9201.0) -
パーサイベントのイベント ID (シンボル) のリストを返します。
...パーサイベントのイベント ID (シンボル) のリストを返します。... -
Ripper
:: SCANNER _ EVENTS -> [Symbol] (9201.0) -
スキャナイベントのイベント ID (シンボル) のリストを返します。
...スキャナイベントのイベント ID (シンボル) のリストを返します。... -
Ripper
. slice(src , pattern , n = 0) -> String | nil (6206.0) -
Ruby プログラム src のうち、 パターン pattern の n 番目の括弧にマッチする文字列を取り出します。
...ン pattern の n 番目の括弧にマッチする文字列を取り出します。
マッチしない場合は nil を返します。
@param src Ruby プログラムを文字列か IO オブジェクトで指定します。
@param pattern 取り出すプログラムのパターンを文字列......の中の文字列だけが必
要な時に指定します。省略すると 0 (pattern 全体)になります。
pattern は Ripper のイベント ID のリストを文字列で記述します。
また pattern には Ruby の正規表現と同じメタ文字も使えます。
ただし......単位ではなくトークン単位で動作します。
使用例
require 'ripper'
p Ripper.slice(%(<<HERE\nstring\#{nil}\nHERE),
"heredoc_beg .*? nl $(.*?) heredoc_end", 1)
# => "string\#{nil}\n"
イベント ID は Ripper::SCANNER_EVENTS で確認できます。... -
TracePoint
. new(*events) {|obj| . . . } -> TracePoint (3307.0) -
新しい TracePoint オブジェクトを作成して返します。トレースを有効 にするには TracePoint#enable を実行してください。
...しい TracePoint オブジェクトを作成して返します。トレースを有効
にするには TracePoint#enable を実行してください。
//emlist[例:irb で実行した場合][ruby]{
trace = TracePoint.new(:call) do |tp|
p [tp.lineno, tp.defined_class, tp.method_id, tp.event]
e......<TracePoint:0x007f17372cdb20>
trace.enable
# => false
puts "Hello, TracePoint!"
# ...
# [69, IRB::Notifier::AbstractNotifier, :printf, :call]
# ...
//}
トレースを無効にするには TracePoint#disable を実行してください。
//emlist[][ruby]{
trace.disable
//}
@param events トレ......ースするイベントを String か Symbol で任
意の数指定します。
: :line
式の評価。
: :class
クラス定義、特異クラス定義、モジュール定義への突入。
: :end
クラス定義、特異クラス定義、モジュール定義の終了... -
TracePoint
. trace(*events) {|obj| . . . } -> TracePoint (3307.0) -
新しい TracePoint オブジェクトを作成して自動的にトレースを開始し ます。TracePoint.new のコンビニエンスメソッドです。
...新しい TracePoint オブジェクトを作成して自動的にトレースを開始し
ます。TracePoint.new のコンビニエンスメソッドです。
@param events トレースするイベントを String か Symbol で任
意の数指定します。指定できる値に......ついては
TracePoint.new を参照してください。
//emlist[例][ruby]{
trace = TracePoint.trace(:call) { |tp| [tp.lineno, tp.event] }
# => #<TracePoint:0x007f786a452448>
trace.enabled? # => true
//}
@raise ThreadError ブロックを指定しなかった場合に発生し... -
Ripper
. sexp(src , filename = & # 39;-& # 39; , lineno = 1) -> object (3206.0) -
Ruby プログラム str を解析して S 式のツリーにして返します。
...て返します。
@param src Ruby プログラムを文字列か IO オブジェクトで指定します。
@param filename src のファイル名を文字列で指定します。省略すると "-" になります。
@param lineno src の開始行番号を指定します。省略すると 1 に......す。
//emlist[例][ruby]{
require 'ripper'
require 'pp'
pp Ripper.sexp("def m(a) nil end")
# => [:program,
# [[:def,
# [:@ident, "m", [1, 4]],
# [:paren, [:params, [[:@ident, "a", [1, 6]]], nil, nil, nil, nil]],
# [:bodystmt, @kw, "nil", [1, 9]], nil, nil, nil]]]]
//}
パ......stmts_add や stmts_new のような _add、_new で終わるパーサイベントを
省略します。_add で終わるパーサイベントはハンドラの引数が 0 個のものが
省略されます。詳しくは Ripper::PARSER_EVENTS を確認してください。
@see Ripper.sexp_raw... -
Ripper
:: Filter # on _ XXX(token , data) -> object (3112.0) -
各種スキャナイベントを実行します。
...の部分を
Ripper::SCANNER_EVENTS にあるスキャナイベントに読み替えてください。
@param token 現在のトークンが指定されます。
@param data 前のイベントハンドラの戻り値です。最初のイベントの場合は
Ripper::Filter#parse の引......数になります。
オーバライドしなかった場合は on_default が実行されます。
このメソッドの戻り値は次のイベントハンドラの data 引数に渡されます。
@see Ripper::Filter#parse, Ripper::Filter#on_default, Ripper::SCANNER_EVENTS... -
ruby 1
. 8 . 4 feature (1590.0) -
ruby 1.8.4 feature ruby 1.8.4 での ruby 1.8.3 からの変更点です。
...更
# * [api]: 拡張ライブラリ API
# * [lib]: ライブラリ
* レベル
* [bug]: バグ修正
* [new]: 追加されたクラス/メソッドなど
* [compat]: 変更されたクラス/メソッドなど
* 互換性のある変更
* only backward-compatibility
* 影......boundMethod#bind [bug]>))
* ((<ruby 1.8.4 feature/set_trace_func [bug]>))
* ((<ruby 1.8.4 feature/set_trace_func [change]>))
* ((<ruby 1.8.4 feature/printf [bug]>))
* ((<ruby 1.8.4 feature/Hash [bug]>))
* ((<ruby 1.8.4 feature/test [bug]>))
* ((<ruby 1.8.4 feature/File.identical? [new]>)......005-09-21) [i686-linux]
0
nil
# => ruby 1.8.4 (2005-12-22) [i686-linux]
0
0
: シグナル [bug]
#Sun Oct 16 03:38:07 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
#
# * rubysig.h (CHECK_INTS): prevent signal handler to run during... -
NEWS for Ruby 3
. 0 . 0 (306.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......tion warning
# 3.0 => a=>1}, {}]
//}
* Arguments forwarding (`...`) now supports leading arguments.
16378
//emlist{
def method_missing(meth, ...)
send(:"do_#{meth}", ...)
end
//}
* Pattern matching (`case/in`) is no longer experimental. 17260
* One-line pattern matching is redesig......hich returns a hash excluding the given keys and their values. 15822
* IO
* IO#nonblock? now defaults to `true`. 16786
* IO#wait_readable, IO#wait_writable, IO#read, IO#write and other related methods (e.g. IO#puts, IO#gets) may invoke the scheduler hook `#io_wait(io, events, timeout)` in...