217件ヒット
[1-100件を表示]
(0.150秒)
ライブラリ
- ビルトイン (121)
- ipaddr (12)
-
rdoc
/ markup / formatter (12) -
rdoc
/ text (12) -
rubygems
/ dependency (12) -
rubygems
/ platform (12) -
rubygems
/ requirement (12) - stringio (12)
- zlib (12)
クラス
-
Gem
:: Dependency (12) -
Gem
:: Platform (12) -
Gem
:: Requirement (12) - IPAddr (12)
- Integer (12)
- NilClass (7)
- Object (21)
-
RDoc
:: Markup :: Formatter (12) - Regexp (24)
- String (45)
- StringIO (12)
- Symbol (12)
-
Zlib
:: GzipWriter (12)
モジュール
-
RDoc
:: Text (12)
検索結果
先頭5件
-
Integer
# ~ -> Integer (21214.0) -
ビット演算子。否定を計算します。
...ビット演算子。否定を計算します。
//emlist[][ruby]{
~1 # => -2
~3 # => -4
~-4 # => 3
//}... -
Regexp
# ~ -> Integer | nil (21208.0) -
変数 $_ の値との間でのマッチをとります。
...][ruby]{
self =~ $_
//}
//emlist[例][ruby]{
$_ = "hogehoge"
if /foo/
puts "match"
else
puts "no match"
end
# => no match
# ただし、警告がでる。warning: regex literal in condition
reg = Regexp.compile("foo")
if ~ reg
puts "match"
else
puts "no match"
end
# => no match
if re......g
puts "match"
else
puts "no match"
end
# => match
# reg は nil でも false でも無いので常にtrue
//}... -
IPAddr
# ~ -> IPAddr (21202.0) -
ビットごとの論理否定により、新しい IPAddr オブジェクトを生成します。
...ビットごとの論理否定により、新しい IPAddr オブジェクトを生成します。... -
Regexp
# =~(string) -> Integer | nil (9207.0) -
文字列 string との正規表現マッチを行います。マッチした場合、 マッチした位置のインデックスを返します(先頭は0)。マッチしなかった 場合、あるいは string が nil の場合には nil を返 します。
...字列 string との正規表現マッチを行います。マッチした場合、
マッチした位置のインデックスを返します(先頭は0)。マッチしなかった
場合、あるいは string が nil の場合には nil を返
します。
//emlist[例][ruby]{
p /foo/ =~ "foo" #......=~ "afoo" # => 1
p /foo/ =~ "bar" # => nil
//}
組み込み変数 $~ もしくは Regexp.last_match にマッチに関する情報 MatchData が設定されます。
文字列のかわりにSymbolをマッチさせることができます。
@param string マッチ対象文字列
@raise TypeErr......or string が nil でも String オブジェクト
でも Symbol でもない場合発生します。
//emlist[例][ruby]{
p /foo/ =~ "foo" # => 0
p Regexp.last_match(0) # => "foo"
p /foo/ =~ "afoo" # => 1
p $~[0] # => "foo"
p /foo/ =~ "bar" # =... -
Gem
:: Platform # =~(other) -> bool (9201.0) -
自身と other のプラットフォームが一致する場合に真を返します。 そうでない場合は、偽を返します。
...自身と other のプラットフォームが一致する場合に真を返します。
そうでない場合は、偽を返します。
other が文字列の場合は、まず Gem::Platform に変換してから比較を行います。
other が文字列でも Gem::Platform でもない場合は......nil を返します。
@param other 比較対象のオブジェクトです。
@see Gem::Platform#===... -
Gem
:: Requirement # =~(version) -> bool (9201.0) -
引数 version が自身に含まれる全ての必要条件を満たす場合に true を返します。 そうでなければ、false を返します。
...引数 version が自身に含まれる全ての必要条件を満たす場合に true を返します。
そうでなければ、false を返します。
@param version Gem::Version のインスタンスを指定します。
//emlist[][ruby]{
req = Gem::Requirement.new("~> 3.2.1")
p req.satisfi......ed_by?(Gem::Version.new('3.2.9')) # => true
p req.satisfied_by?(Gem::Version.new('3.3.0')) # => false
//}... -
String
# =~(other) -> Integer | nil (9201.0) -
正規表現 other とのマッチを行います。 マッチが成功すればマッチした位置のインデックスを、そうでなければ nil を返します。
...正規表現 other とのマッチを行います。
マッチが成功すればマッチした位置のインデックスを、そうでなければ nil を返します。
other が正規表現でも文字列でもない場合は
other =~ self を行います。
このメソッドが実行され......数 $~, $1, ...
にマッチに関する情報が設定されます。
@param other 正規表現もしくは =~ メソッドを持つオブジェクト
@raise TypeError other が文字列の場合に発生します。
//emlist[例][ruby]{
p "string" =~ /str/ # => 0
p "string" =~ /not/......# => nil
p "abcfoo" =~ /foo/ # => 3
//}... -
RDoc
:: Text # strip _ stars(text) -> String (6217.0) -
引数から /* 〜 */ 形式のコメントを削除します。
...引数から /* 〜 */ 形式のコメントを削除します。
@param text 文字列を指定します。... -
Gem
:: Dependency # =~(other) -> bool (6201.0) -
self と other を比較して真偽値を返します。
...self と other を比較して真偽値を返します。
self の Gem::Dependency#name が正規表現として other とマッチしない場合は偽を返します。
self が other との依存関係を満たしていれば真を返します。満たしていなければ偽を返します。...