ライブラリ
- ビルトイン (66)
-
minitest
/ spec (1) -
minitest
/ unit (2) - rubygems (11)
- strscan (44)
クラス
-
ARGF
. class (22) -
MiniTest
:: Unit (2) - Module (1)
- StringScanner (44)
-
Thread
:: Backtrace :: Location (44)
モジュール
- Kernel (11)
キーワード
-
absolute
_ path (11) -
base
_ label (11) - filename (11)
- gem (11)
-
infect
_ with _ assertions (1) - inspect (11)
- path (11)
- puke (1)
-
scan
_ full (11) -
search
_ full (11) -
skip
_ until (11) - skips (1)
-
to
_ s (11)
検索結果
先頭5件
-
StringScanner
# skip(regexp) -> Integer | nil (21332.0) -
スキャンポインタの地点だけで regexp と文字列のマッチを試します。 マッチしたらスキャンポインタを進めマッチした部分文字列の 長さを返します。マッチしなかったら nil を返します。
...を返します。
@param regexp マッチに使用する正規表現を指定します。
//emlist[例][ruby]{
require 'strscan'
s = StringScanner.new('test string')
p s.skip(/\w+/) #=> 4
p s.skip(/\w+/) #=> nil
p s.skip(/\s+/) #=> 1
p s.skip(/\w+/) #=> 6
p s.skip(/./) #=> nil
//}... -
StringScanner
# skip _ until(regexp) -> Integer | nil (12302.0) -
regexp が一致するまで文字列をスキャンします。 マッチに成功したらスキャンポインタを進めて、 スキャン開始位置からマッチ部分の末尾までの部分文字列の長さを返します。 マッチに失敗したら nil を返します。
...nil を返します。
@param regexp マッチに使用する正規表現を指定します。
//emlist[例][ruby]{
require 'strscan'
s = StringScanner.new('test string')
s.scan_until(/str/) # => 8
s.matched # => "str"
s.pos # => 8
s.pre_match # => "test "
//}... -
Thread
:: Backtrace :: Location # absolute _ path -> String (9213.0) -
self が表すフレームの絶対パスを返します。
...list[例][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... -
MiniTest
:: Unit # skips -> Fixnum (9201.0) -
実行しなかったテストケース数を返します。
実行しなかったテストケース数を返します。 -
Module
# infect _ with _ assertions(positive _ prefix , negative _ prefix , skip _ regexp , map = {}) -> () (6308.0) -
BDD 風にテストを書くために使用するメソッド群を定義します。
...使用するメソッド群を定義します。
@param positive_prefix assert の代わりのプレフィックスを指定します。
@param negative_prefix refute の代わりのプレフィックスを指定します。
@param skip_regexp この正規表現にマッチしたメソッドは... -
Thread
:: Backtrace :: Location # inspect -> String (6213.0) -
Thread::Backtrace::Location#to_s の結果を人間が読みやすいような文 字列に変換したオブジェクトを返します。
...
Thread::Backtrace::Location#to_s の結果を人間が読みやすいような文
字列に変換したオブジェクトを返します。
//emlist[例][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end
Foo.new(0..2).loc......ations.map do |call|
puts call.inspect
end
# => "path/to/foo.rb:5:in `initialize'"
# "path/to/foo.rb:9:in `new'"
# "path/to/foo.rb:9:in `<main>'"
//}... -
Thread
:: Backtrace :: Location # to _ s -> String (6213.0) -
self が表すフレームを Kernel.#caller と同じ表現にした文字列を返し ます。
...す。
//emlist[例][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.to_s
end
# => path/to/foo.rb:5:in `initialize'
# path/to/foo.rb:9:in `new'
# path/to/foo.rb:9:in `<m... -
StringScanner
# search _ full(regexp , s , f) -> object (3225.0) -
regexp で指定された正規表現とマッチするまで文字列をスキャンします。
...、s と f の値によって以下のように動作します。
* s が true ならばスキャンポインタを進めます。
* s が false ならばスキャンポインタを進めません。
* f が true ならばスキャン開始位置からマッチした部分の末尾ま......ll(regexp, true, true) は StringScanner#scan_until と同等。
* search_full(regexp, true, false) は StringScanner#skip_until と同等。
* search_full(regexp, false, true) は StringScanner#check_until と同等。
* search_full(regexp, false, false) は StringScanner#exist? と同......am s true ならばスキャンポインタを進めます。
false ならばスキャンポインタを進めません。
@param f true ならばマッチした部分文字列を返します。
false ならばマッチした部分文字列の長さを返します。
//emlist[例... -
ARGF
. class # path -> String (3213.0) -
現在開いている処理対象のファイル名を返します。
...に対しては - を返します。
組み込み変数 $FILENAME と同じです。
$ echo "foo" > foo
$ echo "bar" > bar
$ echo "glark" > glark
$ ruby argf.rb foo bar glark
ARGF.filename # => "foo"
ARGF.read(5) # => "foo\nb"
ARGF.filename # => "bar"
ARGF.skip
ARGF.filename #... -
StringScanner
# scan _ full(regexp , s , f) -> object (3213.0) -
スキャンポインタの位置から regexp と文字列のマッチを試します。
...、s と f の値によって以下のように動作します。
* s が true ならばスキャンポインタを進めます。
* s が false ならばスキャンポインタを進めません。
* f が true ならばマッチした部分文字列を返します。
* f が fals......* scan_full(regexp, true, true) は StringScanner#scan と同等。
* scan_full(regexp, true, false) は StringScanner#skip と同等。
* scan_full(regexp, false, true) は StringScanner#check と同等。
* scan_full(regexp, false, false) は StringScanner#match? と同等。
@par......am s true ならばスキャンポインタを進めます。
false ならばスキャンポインタを進めません。
@param f true ならばマッチした部分文字列を返します。
false ならばマッチした部分文字列の長さを返します。
//emlist[例... -
Thread
:: Backtrace :: Location # base _ label -> String (3213.0) -
self が表すフレームの基本ラベルを返します。通常、 Thread::Backtrace::Location#label から修飾を取り除いたもので構成 されます。
...通常、
Thread::Backtrace::Location#label から修飾を取り除いたもので構成
されます。
//emlist[例][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.ba......se_label
end
# => initialize
# new
# <main>
//}
@see Thread::Backtrace::Location#label...