種類
- インスタンスメソッド (44)
- 文書 (26)
- ライブラリ (11)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) -
NEWS for Ruby 3
. 0 . 0 (4) - fnmatch (11)
- fnmatch? (11)
- irb (11)
-
ruby 1
. 6 feature (11)
検索結果
先頭5件
-
MatchData
# to _ s -> String (21107.0) -
マッチした文字列全体を返します。
...マッチした文字列全体を返します。
//emlist[例][ruby]{
/bar/ =~ "foobarbaz"
p $~ # => #<MatchData:0x401b1be4>
p $~.to_s # => "bar"
//}... -
Symbol
# match(other) -> MatchData | nil (18243.0) -
正規表現 other とのマッチを行います。
...(self.to_s.match(other) と同じです。)
@param other 比較対象のシンボルを指定します。
@return マッチが成功すれば MatchData オブジェクトを、そうでなければ nil を返します。
p :foo.match(/foo/) # => #<MatchData "foo">
p :foobar.match(/bar/)......# => #<MatchData "bar">
p :foo.match(/bar/) # => nil
@see String#match
@see Symbol#match?... -
Symbol
# match(other) -> Integer | nil (18137.0) -
正規表現 other とのマッチを行います。
...(self.to_s.match(other) と同じです。)
@param other 比較対象のシンボルを指定します。
@return マッチが成功すればマッチした位置を、そうでなければ nil を返します。
p :foo.match(/foo/) # => 0
p :foobar.match(/bar/) # => 3
p :foo.match(/bar/......) # => nil
@see String#match... -
Pathname
# fnmatch(pattern , *args) -> bool (6116.0) -
File.fnmatch(pattern, self.to_s, *args) と同じです。
...e.fnmatch(pattern, self.to_s, *args) と同じです。
@param pattern パターンを文字列で指定します。ワイルドカードとして `*', `?', `[]' が使用できま
す。Dir.glob とは違って `{}' や `**/' は使用できません。
@param args File.fnmatch を......参照してください。
//emlist[例][ruby]{
require "pathname"
path = Pathname("testfile")
path.fnmatch("test*") # => true
path.fnmatch("TEST*") # => false
path.fnmatch("TEST*", File::FNM_CASEFOLD) # => true
//}
@see File.fnmatch... -
Pathname
# fnmatch?(pattern , *args) -> bool (6116.0) -
File.fnmatch?(pattern, self.to_s, *args) と同じです。
...e.fnmatch?(pattern, self.to_s, *args) と同じです。
@param pattern パターンを文字列で指定します。ワイルドカードとして `*', `?', `[]' が使用できま
す。Dir.glob とは違って `{}' や `**/' は使用できません。
@param args File.fnmatch......を参照してください。
@see File.fnmatch?... -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (90.0) -
1.6.8から1.8.0への変更点(まとめ) * ((<1.6.8から1.8.0への変更点(まとめ)/インタプリタの変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたクラス/モジュール>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたメソッド>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加された定数>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張されたクラス/メソッド(互換性のある変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/変更されたクラス/メソッド(互換性のない変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/文法の変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/正規表現>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Marshal>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Windows 対応>)) * ((<1.6.8から1.8.0への変更点(まとめ)/廃止された(される予定の)機能>)) * ((<1.6.8から1.8.0への変更点(まとめ)/ライブラリ>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張ライブラリAPI>)) * ((<1.6.8から1.8.0への変更点(まとめ)/バグ修正>)) * ((<1.6.8から1.8.0への変更点(まとめ)/サポートプラットフォームの追加>))
...yield の戻り値になります。
: to_str [compat]
to_str を定義したオブジェクトはより広範囲にStringとして振舞うように
なりました。
文字列を引数に取るほとんどの組み込みメソッドは、to_str による暗黙の
型変換を試......: ((<File/File.extname>)) [new]
追加。ファイル名の拡張子を返します。((<ruby-talk:37617>))
: ((<File/File.fnmatch>)) [new]
: ((<File/File.fnmatch?>)) [new]
追加
このメソッドで使用するフラグ FNM_NOESCAPE, FNM_PATHNAME, FNM_PERIOD,
FNM_CASEFOLD も((......(<Marshal/Object#marshal_dump>)) [new]
追加 ((<ruby-dev:21016>))
=== MatchData
: ((<MatchData#captures|MatchData/captures>)) [new]
追加。((<RCR#139>))
: ((<MatchData#select|MatchData/select>)) [new]
((<MatchData>)) は、Enumerable ではありませんが、Enumerable#select
と... -
irb (48.0)
-
irb は Interactive Ruby の略です。 irb を使うと、Ruby の式を標準入力から簡単に入力・実行することができます。
...な記法は以下の通りです。
: %N
起動しているコマンド名(IRB::Context#irb_name)
: %m
main オブジェクト (self) を to_s した文字列
: %M
main オブジェクト (self) を inspect した文字列
: %l
文字列中のタイプを表す (", ', /, ], `]'は%......ます。
: help(*names)
: irb_help(*names)
RI から Ruby のドキュメントを参照します。
//emlist{
irb(main):001:0> help String#match
...
//}
names を指定しなかった場合は、RI を対話的なモードで起動します。メソッ
ド名などを入力する事......Enter a blank line to exit.
>> String#match
String#match
(from ruby core)
------------------------------------------------------------------------------
str.match(pattern) -> matchdata or nil
str.match(pattern, pos) -> matchdata or nil
...
//}
=== システム変... -
NEWS for Ruby 3
. 0 . 0 (12.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...entError 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 a single rest argument and no keywords.
16166
//emlist[][ruby]{
pr = proc{|*a, **kw| [a, kw]}
pr.call(......guments.
16378
//emlist{
def method_missing(meth, ...)
send(:"do_#{meth}", ...)
end
//}
* Pattern matching (`case/in`) is no longer experimental. 17260
* One-line pattern matching is redesigned. [EXPERIMENTAL]
* `=>` is added. It can be used like a rightward assignment.......tinuously improve the coverage of language features, analysis performance, and usability.
//emlist[][ruby]{
# test.rb
def foo(x)
if x > 10
x.to_s
else
nil
end
end
foo(42)
//}
//emlist{
$ typeprof test.rb
# Classes
class Object
def foo : (Integer) -> String?
end
//}
== Miscellaneo... -
ruby 1
. 6 feature (12.0) -
ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。
...o = "foo"
p foo["bar"] = "baz"
p foo
=> ruby 1.6.7 (2002-03-01) [i586-linux]
"baz"
"foo"
=> -:2:in `[]=': string not matched (IndexError)
from -:2
ruby 1.6.7 (2002-07-30) [i586-linux]
: 2002-06-03 sprintf()
"%d" で引数を整数にするとき.......6.7 (2002-03-01) [i586-linux]
#<MatchData:0x401b1be4>
-:3: wrong argument type nil (expected Match) (TypeError)
^^^^^ MatchData の間違い
=> ruby 1.6.7 (2002-04-04) [i586-linux]
#<MatchData:0x401b1c98>
nil
: 2002-03-2......まり、名前解
決中にThreadが切替え可能ということです)
require 'resolv'
p Resolv.new.getaddress("www.ruby-lang.org").to_s
=> /usr/local/lib/ruby/1.6/resolv.rb:160: warning: timeout (...) interpreted as method call
/usr/local/lib/ruby/1.6/resolv.rb:55: warni...