るりまサーチ

最速Rubyリファレンスマニュアル検索!
124件ヒット [1-100件を表示] (0.154秒)

別のキーワード

  1. _builtin -
  2. open-uri open
  3. irb/input-method gets
  4. irb/input-method new
  5. matrix -

ライブラリ

モジュール

キーワード

検索結果

<< 1 2 > >>

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 の結果を人間が読みやすいような文 字列に変換したオブジェクトを返します。

...
T
hread::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 から修飾を取り除いたもので構成 されます。

...通常、
T
hread::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...
<< 1 2 > >>