るりまサーチ

最速Rubyリファレンスマニュアル検索!
336件ヒット [101-200件を表示] (0.007秒)

別のキーワード

  1. _builtin ^
  2. set ^
  3. integer ^
  4. nilclass ^
  5. trueclass ^

検索結果

<< < 1 2 3 4 > >>

ruby 1.6 feature (30.0)

ruby 1.6 feature ruby version 1.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-25...
...03-19) [i586-linux]
"表"

#! ruby -Ks
p %[評価]
=> -:2: parse error
p %[評価]
^

ruby 1.6.7 (2002-03-15) [i586-linux]

=> ruby 1.6.7 (2002-03-19) [i586-linux]
"評価"

: 2002-03-16 $~...
...ました。

p %q1..1

=> ruby 1.6.5 (2001-10-10) [i586-linux]
".."
=> -:1: unknown type of %string
p %q1..1
^

ruby 1.6.5 (2001-10-15) [i586-linux]

: String#=~

String#=~ の呼出で両辺ともリテラルであったときに速度重視...

パターンマッチ (24.0)

パターンマッチ * patterns * variable_binding * variable_pinning * matching_non_primitive_objects * guard_clauses * current_feature_status * pattern_syntax * some_undefined_behavior_examples

...ターンの部品として利用するよ」ということを伝えるためにピン演算子 『^』 を利用することができます。

//emlist[][ruby]{
expectation = 18
case [1, 2]
in ^expectation, *rest
"matched. expectation was: #{expectation}"
else
"not matched. expectation was: #...
...{id:, level: ^school}] # select the last school, level should match
"matched. school: #{id}"
else
"not matched"
end
#=> "matched. school: 2"

case john # 指定された school の level は "high" だが、最後の school はマッチしない
in school:, schools: [*, {id:, level: ^school}]...
...e_pattern
| as_pattern
| array_pattern
| hash_pattern

value_pattern: literal
| Constant
| ^variable

variable_pattern: variable

alternative_pattern: pattern | pattern | ...

as_pattern: pattern => variable

array_pattern: [pattern,...
...pattern
| array_pattern
| find_pattern
| hash_pattern

value_pattern: literal
| Constant
| ^variable

variable_pattern: variable

alternative_pattern: pattern | pattern | ...

as_pattern: pattern => variable

array_pattern: [pattern,...

Dir.[](*pattern) -> [String] (12.0)

ワイルドカードの展開を行い、 パターンにマッチするファイル名を文字列の配列として返します。 パターンにマッチするファイルがない場合は空の配列を返します。

...一致します。- でつな
がれた文字は範囲を表します。鈎括弧の中の最初の文字が
^
である時には含まれない文字と一致します。
^
の代わりに ksh や POSIX shell のように ! も同じ意
味で使えます。
: { }
コンマで...
...o", "bar"]
p Dir["f*", "b*"] # => ["foo", "bar"]
p Dir.glob("f*\0b*") # => ["foo", "bar"]

# ワイルドカードの例
Dir.glob("*") #=> ["foo", "bar"]
Dir.glob("fo?") #=> ["foo"]
Dir.glob("[^f]*") #=> ["bar"]
Dir.glob("{b,f}*") #=> ["bar", "foo"]

//}...

Dir.[](*pattern, base: nil) -> [String] (12.0)

ワイルドカードの展開を行い、 パターンにマッチするファイル名を文字列の配列として返します。 パターンにマッチするファイルがない場合は空の配列を返します。

...一致します。- でつな
がれた文字は範囲を表します。鈎括弧の中の最初の文字が
^
である時には含まれない文字と一致します。
^
の代わりに ksh や POSIX shell のように ! も同じ意
味で使えます。
: { }
コンマで...
...") # => ["foo", "bar"]

# ワイルドカードの例
Dir.glob("*") #=> ["foo", "bar"]
Dir.glob("fo?") #=> ["foo"]
Dir.glob("[^f]*") #=> ["bar"]
Dir.glob("{b,f}*") #=> ["bar", "foo"]

# ベースディレクトリの例
rbfiles = File.join("**", "*.rb")
Dir.glob(...
...# => ["foo", "bar"]

# ワイルドカードの例
Dir.glob("*") #=> ["foo", "bar"]
Dir.glob("fo?") #=> ["foo"]
Dir.glob("[^f]*") #=> ["bar"]
Dir.glob("{b,f}*") #=> ["bar", "foo"]

# ベースディレクトリの例
rbfiles = File.join("**", "*.rb")
Dir.glob(...

Dir.[](*pattern, base: nil, sort: true) -> [String] (12.0)

ワイルドカードの展開を行い、 パターンにマッチするファイル名を文字列の配列として返します。 パターンにマッチするファイルがない場合は空の配列を返します。

...一致します。- でつな
がれた文字は範囲を表します。鈎括弧の中の最初の文字が
^
である時には含まれない文字と一致します。
^
の代わりに ksh や POSIX shell のように ! も同じ意
味で使えます。
: { }
コンマで...
...# => ["foo", "bar"]

# ワイルドカードの例
Dir.glob("*") #=> ["foo", "bar"]
Dir.glob("fo?") #=> ["foo"]
Dir.glob("[^f]*") #=> ["bar"]
Dir.glob("{b,f}*") #=> ["bar", "foo"]

# ベースディレクトリの例
rbfiles = File.join("**", "*.rb")
Dir.glob(...

絞り込み条件を変える

Dir.glob(pattern, flags = 0) -> [String] (12.0)

ワイルドカードの展開を行い、 パターンにマッチするファイル名を文字列の配列として返します。 パターンにマッチするファイルがない場合は空の配列を返します。

...一致します。- でつな
がれた文字は範囲を表します。鈎括弧の中の最初の文字が
^
である時には含まれない文字と一致します。
^
の代わりに ksh や POSIX shell のように ! も同じ意
味で使えます。
: { }
コンマで...
...o", "bar"]
p Dir["f*", "b*"] # => ["foo", "bar"]
p Dir.glob("f*\0b*") # => ["foo", "bar"]

# ワイルドカードの例
Dir.glob("*") #=> ["foo", "bar"]
Dir.glob("fo?") #=> ["foo"]
Dir.glob("[^f]*") #=> ["bar"]
Dir.glob("{b,f}*") #=> ["bar", "foo"]

//}...

Dir.glob(pattern, flags = 0) {|file| ...} -> nil (12.0)

ワイルドカードの展開を行い、 パターンにマッチするファイル名を文字列の配列として返します。 パターンにマッチするファイルがない場合は空の配列を返します。

...一致します。- でつな
がれた文字は範囲を表します。鈎括弧の中の最初の文字が
^
である時には含まれない文字と一致します。
^
の代わりに ksh や POSIX shell のように ! も同じ意
味で使えます。
: { }
コンマで...
...o", "bar"]
p Dir["f*", "b*"] # => ["foo", "bar"]
p Dir.glob("f*\0b*") # => ["foo", "bar"]

# ワイルドカードの例
Dir.glob("*") #=> ["foo", "bar"]
Dir.glob("fo?") #=> ["foo"]
Dir.glob("[^f]*") #=> ["bar"]
Dir.glob("{b,f}*") #=> ["bar", "foo"]

//}...

Dir.glob(pattern, flags = 0, base: nil) -> [String] (12.0)

ワイルドカードの展開を行い、 パターンにマッチするファイル名を文字列の配列として返します。 パターンにマッチするファイルがない場合は空の配列を返します。

...一致します。- でつな
がれた文字は範囲を表します。鈎括弧の中の最初の文字が
^
である時には含まれない文字と一致します。
^
の代わりに ksh や POSIX shell のように ! も同じ意
味で使えます。
: { }
コンマで...
...") # => ["foo", "bar"]

# ワイルドカードの例
Dir.glob("*") #=> ["foo", "bar"]
Dir.glob("fo?") #=> ["foo"]
Dir.glob("[^f]*") #=> ["bar"]
Dir.glob("{b,f}*") #=> ["bar", "foo"]

# ベースディレクトリの例
rbfiles = File.join("**", "*.rb")
Dir.glob(...
...# => ["foo", "bar"]

# ワイルドカードの例
Dir.glob("*") #=> ["foo", "bar"]
Dir.glob("fo?") #=> ["foo"]
Dir.glob("[^f]*") #=> ["bar"]
Dir.glob("{b,f}*") #=> ["bar", "foo"]

# ベースディレクトリの例
rbfiles = File.join("**", "*.rb")
Dir.glob(...

Dir.glob(pattern, flags = 0, base: nil) {|file| ...} -> nil (12.0)

ワイルドカードの展開を行い、 パターンにマッチするファイル名を文字列の配列として返します。 パターンにマッチするファイルがない場合は空の配列を返します。

...一致します。- でつな
がれた文字は範囲を表します。鈎括弧の中の最初の文字が
^
である時には含まれない文字と一致します。
^
の代わりに ksh や POSIX shell のように ! も同じ意
味で使えます。
: { }
コンマで...
...") # => ["foo", "bar"]

# ワイルドカードの例
Dir.glob("*") #=> ["foo", "bar"]
Dir.glob("fo?") #=> ["foo"]
Dir.glob("[^f]*") #=> ["bar"]
Dir.glob("{b,f}*") #=> ["bar", "foo"]

# ベースディレクトリの例
rbfiles = File.join("**", "*.rb")
Dir.glob(...
...# => ["foo", "bar"]

# ワイルドカードの例
Dir.glob("*") #=> ["foo", "bar"]
Dir.glob("fo?") #=> ["foo"]
Dir.glob("[^f]*") #=> ["bar"]
Dir.glob("{b,f}*") #=> ["bar", "foo"]

# ベースディレクトリの例
rbfiles = File.join("**", "*.rb")
Dir.glob(...

Dir.glob(pattern, flags = 0, base: nil, sort: true) -> [String] (12.0)

ワイルドカードの展開を行い、 パターンにマッチするファイル名を文字列の配列として返します。 パターンにマッチするファイルがない場合は空の配列を返します。

...一致します。- でつな
がれた文字は範囲を表します。鈎括弧の中の最初の文字が
^
である時には含まれない文字と一致します。
^
の代わりに ksh や POSIX shell のように ! も同じ意
味で使えます。
: { }
コンマで...
...# => ["foo", "bar"]

# ワイルドカードの例
Dir.glob("*") #=> ["foo", "bar"]
Dir.glob("fo?") #=> ["foo"]
Dir.glob("[^f]*") #=> ["bar"]
Dir.glob("{b,f}*") #=> ["bar", "foo"]

# ベースディレクトリの例
rbfiles = File.join("**", "*.rb")
Dir.glob(...

絞り込み条件を変える

Dir.glob(pattern, flags = 0, base: nil, sort: true) {|file| ...} -> nil (12.0)

ワイルドカードの展開を行い、 パターンにマッチするファイル名を文字列の配列として返します。 パターンにマッチするファイルがない場合は空の配列を返します。

...一致します。- でつな
がれた文字は範囲を表します。鈎括弧の中の最初の文字が
^
である時には含まれない文字と一致します。
^
の代わりに ksh や POSIX shell のように ! も同じ意
味で使えます。
: { }
コンマで...
...# => ["foo", "bar"]

# ワイルドカードの例
Dir.glob("*") #=> ["foo", "bar"]
Dir.glob("fo?") #=> ["foo"]
Dir.glob("[^f]*") #=> ["bar"]
Dir.glob("{b,f}*") #=> ["bar", "foo"]

# ベースディレクトリの例
rbfiles = File.join("**", "*.rb")
Dir.glob(...

Rubyで使われる記号の意味(正規表現の複雑な記号は除く) (12.0)

Rubyで使われる記号の意味(正規表現の複雑な記号は除く) ex q num per and or  plus minus ast slash hat sq  period comma langl rangl eq tilde  dollar at under lbrarbra  lbra2rbra2 lbra3rbra3 dq colon ac  backslash semicolon

...味する

===[a:hat] ^

: true ^ true

「xor」演算子。排他的論理和。または類似のメソッド。

: a ^= true

^」演算子の自己代入演算子。aの論理値の反転。
//emlist{
p(a=true);p(a^=true);p(a^=true) #=> true false true
//}

: /^xxx/

正規表現で...
...を含まない Range オブジェクトを作る範囲演算子です。
全体で範囲式といいます。d:spec/operator#range。

: if /^begin/ .. /^end/ など 条件式 式 .. 式

条件式中の範囲式は特別にフリップフロップのように働きます。

//emlist{
'12345...
..."some",:ok]

配列のリテラル

: 'abcde'[1,2]

[]メソッドの実行
//emlist{
class String
def [](*a)
'(^^;'
end
end
p( 'abcde'[1,2] ) #=> "(^^;"
//}

: /xx[abc]/

正規表現の文字クラス指定。

===[a:lbra3] (
===[a:rbra3] )

: (true and false)
: p({})

...

Rubyの起動 (12.0)

Rubyの起動 * cmd_option * shebang

...まり, "ruby"という文字列を含む行までを
読み飛ばします。スクリプトの終りはEOF(ファイル
の終り), ^D(コントロールD), ^Z(コ
ントロールZ)または予約語__END__で指定されます。

ディレクトリ名を指定すると、スクリプト...

Timeout.#timeout(sec, exception_class = nil) {|i| ... } -> object (12.0)

ブロックを sec 秒の期限付きで実行します。 ブロックの実行時間が制限を過ぎたときは例外 Timeout::Error が発生します。

...2)*4" | bc ; echo "count = $((m1+m2))" ; exit 0' INT
m1=0
m2=0

while true
do
x="($RANDOM/$M)"
y="($RANDOM/$M)"
c=$(echo "$S;$x^2+$y^2 < 1.0" | bc)
echo $x $y $c
if [ $c -eq 1 ]
then
let m1++
else
let m2++
fi
done
SHELL_EOT
}

File.chmod(07...

Timeout.#timeout(sec, exception_class, message) {|i| ... } -> object (12.0)

ブロックを sec 秒の期限付きで実行します。 ブロックの実行時間が制限を過ぎたときは例外 Timeout::Error が発生します。

...2)*4" | bc ; echo "count = $((m1+m2))" ; exit 0' INT
m1=0
m2=0

while true
do
x="($RANDOM/$M)"
y="($RANDOM/$M)"
c=$(echo "$S;$x^2+$y^2 < 1.0" | bc)
echo $x $y $c
if [ $c -eq 1 ]
then
let m1++
else
let m2++
fi
done
SHELL_EOT
}

File.chmod(07...

絞り込み条件を変える

rubygems (12.0)

RubyGems を扱うためのクラスやモジュールが定義されているライブラリです。

...より詳細な条件で検索したい場合は query を使用してください。

$ gem query -n ^rails$ -r # rails にちょうど一致するものを検索する
$ gem query -n ^rails -r # rails で始まるものを検索する

パッケージの詳細からキーワード検索す...
<< < 1 2 3 4 > >>