種類
- インスタンスメソッド (44)
- 文書 (37)
- モジュール関数 (22)
ライブラリ
- ビルトイン (66)
モジュール
- Enumerable (44)
-
Process
:: GID (11) -
Process
:: UID (11)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) -
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 3
. 0 . 0 (4) - detect (22)
-
from
_ name (22) -
ruby 1
. 6 feature (11)
検索結果
先頭5件
-
Enumerable
# find(ifnone = nil) -> Enumerator (15138.0) -
要素に対してブロックを評価した値が真になった最初の要素を返します。
...えば Proc) を指定します。
//emlist[例][ruby]{
# 最初の 3 の倍数を探す
p [1, 2, 3, 4, 5].find {|i| i % 3 == 0 } # => 3
p [2, 2, 2, 2, 2].find {|i| i % 3 == 0 } # => nil
# ifnone の使用例
ifnone = proc { raise ArgumentError, "item not found" }
p [1, 2, 3, 4, 5].find(ifnone... -
Enumerable
# find(ifnone = nil) {|item| . . . } -> object (15138.0) -
要素に対してブロックを評価した値が真になった最初の要素を返します。
...えば Proc) を指定します。
//emlist[例][ruby]{
# 最初の 3 の倍数を探す
p [1, 2, 3, 4, 5].find {|i| i % 3 == 0 } # => 3
p [2, 2, 2, 2, 2].find {|i| i % 3 == 0 } # => nil
# ifnone の使用例
ifnone = proc { raise ArgumentError, "item not found" }
p [1, 2, 3, 4, 5].find(ifnone... -
Process
:: GID . # from _ name(name) -> Integer (3012.0) -
引数で指定した名前の実グループ ID を返します。
...した名前の実グループ ID を返します。
Process::GID.from_name("wheel") # => 0
Process::GID.from_name("nosuchgroup") # => can't find group for nosuchgroup (ArgumentError)
@param name グループ名を指定します。
@raise ArgumentError 引数で指定したグループが存... -
Process
:: UID . # from _ name(name) -> Integer (3012.0) -
引数で指定した名前の実ユーザ ID を返します。
...指定した名前の実ユーザ ID を返します。
Process::UID.from_name("root") # => 0
Process::UID.from_name("nosuchuser") # => can't find user for nosuchuser (ArgumentError)
@param name ユーザ名を指定します。
@raise ArgumentError 引数で指定したユーザが存在し... -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (294.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への変更点(まとめ)/サポートプラットフォームの追加>))
...らしい
^^;;)
: ((<Proc/Proc.new>)) [change]
: ((<組み込み関数/lambda>)) [change]
: ((<組み込み関数/proc>)) [change]
以下のように変更されました。((<ruby-dev:20358>))
* Proc.new およびブロック引数で与えられる Proc は
引数チェ......て渡すようになりまし
た。以前は、& 修飾できるのは Proc, Method オブジェクト限定でした。
これに伴い Proc#to_proc が追加されました。
: 終了ステータス [compat]
raise SystemExit したときに終了ステータス 1 で終了するよう......。
また、空白類に特殊な意味はなくなりました('\0'の効果は残っています)。
=== Enumerable
: ((<Enumerable#find|Enumerable/find>)) [change]
引数に文字列を指定できなくなりました。
また、要素が見つからなかった場合は、ifnone の... -
NEWS for Ruby 2
. 0 . 0 (66.0) -
NEWS for Ruby 2.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...す
* Hash
* 追加: Hash#to_h 明示的に変換するメソッドです。Array#to_a に似ています
* 拡張: Hash#default_proc= default proc をクリアするために nil を渡せるようになりました
* IO
* 非推奨: IO#lines, #bytes, #chars, #codepoints
* Kern......m
* openssl
* Consistently raise an error when trying to encode nil values. All instances
of OpenSSL::ASN1::Primitive now raise TypeError when calling to_der on an
instance whose value is nil. All instances of OpenSSL::ASN1::Constructive
raise NoMethodError in the same case.......* 拡張: OpenStruct.new OpenStruct/Struct のインスタンスを受け付けるようになりました
* pathname
* 拡張: Pathname#find ブロックを与えない場合 Enumerator を返すようになりました
* rake
* 0.9.5 に更新
* This version is backwards-co... -
ruby 1
. 6 feature (66.0) -
ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。
...-:3: warning: ambiguous first argument; make sure
ruby 1.6.7 (2002-07-30) [i586-linux]
"\\#"
nil
: 2002-04-29: rb_find_file()
$SAFE >= 4 で、絶対パス指定でない場合、SecurityError 例外が発生する
ようになりました。
: 2002-04-26: Reg......d>))
サイズが 0 で中身のあるファイル(Linux の /proc ファイルシステムでこ
のような場合があります)が File#read などで読めないバグが修正されまし
た。
p File.open("/proc/#$$/cmdline").read
=> ruby 1.6.7 (2002-03-01) [i586-li......(rb_safe_level() >= 4 && !OBJ_TAINTED(klass)) {
+ if (rb_safe_level() >= 4 && (klass == rb_cObject || !OBJ_TAINTED(klass))) {
rb_raise(rb_eSecurityError, "Insecure: can't define method");
}
if (OBJ_FROZEN(klass)) rb_error_frozen("class/module");
また今度... -
NEWS for Ruby 3
. 0 . 0 (60.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...ror 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([1])....../emlist{
0 => a
p a #=> 0
{b: 0, c: 1} => {b:}
p b #=> 0
//}
//emlist{
# version 3.0
0 in 1 #=> false
# version 2.7
0 in 1 #=> raise NoMatchingPatternError
//}
* Find-pattern is added. [EXPERIMENTAL]
16828
//emlist{
case ["a", 1, "b", "c", 2, "d", "e", "f", 3]
in [*pre, String => x, Stri......ad of a LocalJumpError. 15575
* When a class variable is overtaken by the same definition in an
ancestor class/module, a RuntimeError is now raised (previously,
it only issued a warning in verbose mode). Additionally, accessing a
class variable from the toplevel scope is now a Runtim... -
Enumerable
# detect(ifnone = nil) -> Enumerator (38.0) -
要素に対してブロックを評価した値が真になった最初の要素を返します。
...えば Proc) を指定します。
//emlist[例][ruby]{
# 最初の 3 の倍数を探す
p [1, 2, 3, 4, 5].find {|i| i % 3 == 0 } # => 3
p [2, 2, 2, 2, 2].find {|i| i % 3 == 0 } # => nil
# ifnone の使用例
ifnone = proc { raise ArgumentError, "item not found" }
p [1, 2, 3, 4, 5].find(ifnone... -
Enumerable
# detect(ifnone = nil) {|item| . . . } -> object (38.0) -
要素に対してブロックを評価した値が真になった最初の要素を返します。
...えば Proc) を指定します。
//emlist[例][ruby]{
# 最初の 3 の倍数を探す
p [1, 2, 3, 4, 5].find {|i| i % 3 == 0 } # => 3
p [2, 2, 2, 2, 2].find {|i| i % 3 == 0 } # => nil
# ifnone の使用例
ifnone = proc { raise ArgumentError, "item not found" }
p [1, 2, 3, 4, 5].find(ifnone...