種類
- インスタンスメソッド (111)
- 文書 (15)
- 特異メソッド (12)
ライブラリ
- ビルトイン (66)
- csv (11)
-
minitest
/ unit (1) - strscan (44)
-
test
/ unit (1)
クラス
-
ARGF
. class (22) - CSV (11)
-
MiniTest
:: Unit (1) - StringScanner (44)
-
Thread
:: Backtrace :: Location (44)
モジュール
-
Test
:: Unit (1)
キーワード
-
NEWS for Ruby 3
. 0 . 0 (4) -
absolute
_ path (11) -
base
_ label (11) - filename (11)
- inspect (11)
- new (11)
- path (11)
- puke (1)
-
ruby 1
. 8 . 4 feature (11) -
scan
_ full (11) -
search
_ full (11) -
setup
_ argv (1) -
skip
_ until (11) -
to
_ s (11)
検索結果
先頭5件
-
StringScanner
# skip(regexp) -> Integer | nil (21137.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 (9107.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 "
//}... -
StringScanner
# search _ full(regexp , s , f) -> object (3030.0) -
regexp で指定された正規表現とマッチするまで文字列をスキャンします。
...(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? と同等......n'
s = StringScanner.new('test string')
p s.search_full(/t/, true, true) #=> "t"
p s.search_full(/str/, false, true) #=> "est str"
p s.search_full(/string/, true, true) #=> "est string"
//}
@see StringScanner#scan_until StringScanner#skip_until StringScanner#check_until StringScanner... -
StringScanner
# scan _ full(regexp , s , f) -> object (3024.0) -
スキャンポインタの位置から regexp と文字列のマッチを試します。
...* 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? と同等。
@param......= StringScanner.new('test string')
p s.scan_full(/\w+/, true, true) #=> "test"
p s.scan_full(/\s+/, false, true) #=> " "
p s.scan_full(/\s+/, true, false) #=> 1
p s.scan_full(/\w+/, false, false) #=> 6
p s.scan_full(/\w+/, true, true) #=> "string"
//}
@see StringScanner#scan StringS......canner#skip StringScanner#check StringScanner#match?... -
NEWS for Ruby 3
. 0 . 0 (270.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...", "f", 3]
in [*pre, String => x, String => y, *post]
p pre #=> ["a", 1]
p x #=> "b"
p y #=> "c"
p post #=> [2, "d", "e", "f", 3]
end
//}
* Endless method definition is added. [EXPERIMENTAL]
16746
//emlist{
def square(x) = x * x
//}
* Interpolated String literals are no lo......nger frozen when
`# frozen-string-literal: true` is used. 17104
* Magic comment `shareable_constant_value` added to freeze constants.
See {Magic Comments}[rdoc-ref:doc/syntax/comments.rdoc@Magic+Comments] for more details.
17273
* A {static analysis}[rdoc-label:label-Static+analysis]......et
* Add :connect_timeout to TCPSocket.new 17187
* Net::HTTP
* Net::HTTP#verify_hostname= and Net::HTTP#verify_hostname have been added to skip hostname verification. 16555
* Net::HTTP.get, Net::HTTP.get_response, and Net::HTTP.get_print can take the request headers as a Hash in the s... -
Thread
:: Backtrace :: Location # absolute _ path -> String (113.0) -
self が表すフレームの絶対パスを返します。
...レームの絶対パスを返します。
//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.absolute_path
end
# => /path/to/foo.rb
# /path/to/foo.rb
# /path... -
Thread
:: Backtrace :: Location # base _ label -> String (113.0) -
self が表すフレームの基本ラベルを返します。通常、 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.base_label
end
# => initialize
# new
# <main>
//}
@see Thread::Ba... -
Thread
:: Backtrace :: Location # inspect -> String (113.0) -
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).locations.map do |call|
puts call.inspect
end
# => "path/to/foo.rb:5:in `initialize'"
# "path/to/f... -
Thread
:: Backtrace :: Location # to _ s -> String (113.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:... -
ARGF
. class # filename -> String (108.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 # => "glark"...