キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) -
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 5 . 0 (7) -
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) - Rubyで使われる記号の意味(正規表現の複雑な記号は除く) (11)
- Ruby用語集 (11)
- pack テンプレート文字列 (11)
-
ruby 1
. 8 . 3 feature (11) - 演算子式 (11)
検索結果
先頭5件
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (559.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への変更点(まとめ)/サポートプラットフォームの追加>))
...りました。
* nil: 警告を出力しない (-W0 新しい警告レベル)
* false: 重要な警告のみ出力 (-W1 デフォルト)
* true: すべての警告を出力する (-W2 or -W or -v or -w or --verbose)
追加された -W オプションは $VERBOSE = nil の指定(-W0)を......from -:1
ruby 1.6.8 (2002-12-24) [i586-linux]
=> ruby 1.8.0 (2003-06-21) [i586-linux]
[1, 2, nil]
Proc.new { break }.call
=> ruby 1.6.8 (2002-12-24) [i586-linux]
=> -:1:in `call': break from proc-c......して値を返すようになりました。
class/module は最後に評価した式の結果を返します。def は nil を返し
ます。while/until は、通常 nil を返しますが、break の引数により任意
の値を返すことができます。
: 多重代入 [change]... -
NEWS for Ruby 2
. 7 . 0 (163.0) -
NEWS for Ruby 2.7.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...で**nilと書くことで、このメソッドがキーワードを
受け取らないことを明示できるようになりました。このようなメソッドを
キーワード引数付きで呼び出すとArgumentErrorになります。 14183
//emlist[][ruby]{
def foo(h, **nil); en......d; foo(key: 1) # ArgumentError
def foo(h, **nil); end; foo(**{key: 1}) # ArgumentError
def foo(h, **nil); end; foo("str" => 1) # ArgumentError
def foo(h, **nil); end; foo({key: 1}) # OK
def foo(h, **nil); end; foo({"str" => 1}) # OK
//}
* キーワード引数を受け取らない......bar
lambda
end
bar { puts "Hello" } #=> tried to create Proc object without a block (ArgumentError)
//}
==== その他の変更
* 始端なしRangeが実験的に導入されました。
caseやComparable#clampや定数やDSLなどで便利かもしれません。
14799
//emlist[][rub... -
演算子式 (129.0)
-
演算子式 * assign * selfassign * multiassign * range * range_cond * and * or * not * cond
...演算子式
* assign
* selfassign
* multiassign
* range
* range_cond
* and
* or
* not
* cond
//emlist[例][ruby]{
1+2*3/4
//}
プログラミングの利便のために一部のメソッド呼び出しと制御構造は演算子形
式をとります。Rubyには以下にあげ......方が多い場合には、余った要素は無視されます。
配列の要素が足りない場合には対応する要素の無い左辺には
nil が代入されます。
左辺の最後の式の直前に * がついていると、対応する
左辺のない余った要素が配列として......bar = [1, 2] # foo = 1; bar = 2
foo, bar = 1, 2 # foo = 1; bar = 2
foo, bar = 1 # foo = 1; bar = nil
foo, bar, baz = 1, 2 # foo = 1; bar = 2; baz = nil
foo, bar = 1, 2, 3 # foo = 1; bar = 2
foo = 1, 2, 3 # foo = [1, 2, 3]
*foo = 1, 2, 3 # foo = [1... -
NEWS for Ruby 2
. 5 . 0 (61.0) -
NEWS for Ruby 2.5.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...ransform_keys を追加 13583
* Hash#transform_keys! を追加 13583
* Hash#slice を追加 8499
* IO
* IO.copy_stream は copy_file_range(2) を使うようになりました。また、その実装が使えない場合は他の実装へフォールバックするようにしまし......ました。
coerceがnilを返す場合、変換は不可能です。7688
* Process
* getrusage(2) が存在する場合 Process.#times の精度を改良しました 11952
* Process.last_status を追加。$? と同じです 14043
* Range
* Range.new no longer hides excepti......his much improves the speed of generating documents.
* It also facilitates supporting new syntax in the future.
* Support many new syntaxes of Ruby from the past few years.
* Use "frozen_string_literal: true".
This reduces document generation time by 5%.
* Support d... -
Rubyで使われる記号の意味(正規表現の複雑な記号は除く) (61.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}" #=> "a is 10"
//}
: Range#each
説明文の中でのみ使われます。Ruby言語の要素ではありません。クラスのインスタンスメソッドであることを
簡単に表示するための表記法です。一方、クラスメソッドは「Range.new」のように「.......をブロックとして使う。d:spec/call#block を参照。
: xxx&.yyy
safe navigation operator(通称「ぼっち演算子」)。xxx が nil でないときにメソッドyyyを呼び出す。spec/call を参照。
===[a:or] |
: 3 | 5
論理和演算子または類似のメソッド......クトのメソッド
: Range.new
オブジェクトのメソッドだが、説明文の中では特にクラスのクラスメソッド/モジュールの
モジュールメソッドを示すことに使われます。一方、インスタンスメソッドは「Range#each」のように
「... -
NEWS for Ruby 2
. 0 . 0 (49.0) -
NEWS for Ruby 2.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...には最大値のみを指定することが可能になりました
* Array#values_at に Range オブジェクトを与えた場合、配列の範囲外のインデックスについては nil を返します
* Enumerable
* 追加: Enumerable#lazy 遅延列挙のためのメソッド......明示的に変換するメソッドです。Array#to_a に似ています
* 拡張: Hash#default_proc= default proc をクリアするために nil を渡せるようになりました
* IO
* 非推奨: IO#lines, #bytes, #chars, #codepoints
* Kernel
* 追加: Kernel.#Hash とい......olv
* 追加: Resolv::DNS#timeouts=
* 追加: Resolv::DNS::Config#timeouts=
* rexml
* REXML::Document#write はハッシュ引数をサポートしました
* REXML::Document#write は :encoding オプションをサポートしました。
XMLドキュメントのエンコ... -
Ruby用語集 (49.0)
-
Ruby用語集 A B C D E F G I J M N O R S Y
...持つ。
https://mruby.org/
: main
トップレベルにおける self。Object クラスのインスタンスである。
===[a:N] N
: nil
NilClass の唯一のインスタンス。また、そのオブジェクトを指す擬似変数の名前。
論理値としては偽である。......し、切り替えて使うための
ツールの一つ。Linux、macOS などで動作する。
https://github.com/rbenv/rbenv
: RD(Ruby Document format)
Ruby スクリプト中に記述することを念頭に作られたドキュメントフォーマット。
: RDoc
Ruby スクリ......in、end、nil、__FILE__ といったものが該当する。
メソッド名の場合、def のあとに書いたり、レシーバーを明示して
呼び出すなど、構文上、メソッド名であることが明らかな場面では使える場合もある。
実際 Range クラス... -
ruby 1
. 8 . 3 feature (49.0) -
ruby 1.8.3 feature *((<ruby 1.8 feature>)) *((<ruby 1.8.2 feature>))
...2 -e 'p ("x".taint[1..-1]).tainted?'
false
$ ruby-1.8.3 -e 'p ("x".taint[1..-1]).tainted?'
true
Range オブジェクトが taint されている場合、"string"[range] も taint されるようになりました。((<ruby-dev:27121>))
$ ruby-1.8.2 -e 'p ("x"[(0..-1).taint]......オプションに -w を付けた時に出ます。((<ruby-dev:26201>))
=== 2005-05-22
: OpenSSL::SSL::SSLServer#initialize(svr, ctx, session_id=nil)
session_id を受け付けるようになりました。((<ruby-core:4663>))
=== 2005-05-19
: REXML::Encoding#decode_sjis [lib] [bug]
: REXML::......-foo@bar (NameError)
=== 2005-04-18
: WIN32OLE.codepage [lib] [new]
: WIN32OLE.codepage= [lib] [new]
=== 2005-04-10
: WIN32OLE#invoke [lib] [bug]
nil を VT_ERROR に変換して Invokeを呼び出して失敗するときには VT_EMPTYに変換して
再度 Invokeを呼び出すようにし... -
pack テンプレート文字列 (37.0)
-
pack テンプレート文字列
..."\x98\xE5\x9ER\xD2U\x00\x00p\xE5\x9ER\xD2U\x00\x00H\xE5\x9ER\xD2U\x00\x00"
[nil].pack("p") # => "\x00\x00\x00\x00\x00\x00\x00\x00"
//}
: P
構造体(固定長文字列)へのポインタ
//emlist[][ruby]{
[nil].pack("P") # => "\x00\x00\x00\x00\x00\x00\x00\x00"
["abc"].pack("P3") #......0080"
[0x7fffffff].pack("U") # => "\xFD\xBF\xBF\xBF\xBF\xBF"
[0x80000000].pack("U") # => RangeError: pack(U): value out of range
[0,256,65536].pack("U3").b # => "\x00\xC4\x80\xF0\x90\x80\x80"
"\x00\xC4\x80\xF0\x90\x80\x80".unpack("U3") # =>......}
"p" や "P" は、nil を特別に扱い NULL
ポインタとして解釈します。(以下は、64bitマシンで一般的な結果)
//emlist[][ruby]{
[nil].pack("p") # => "\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00".unpack("p") # => [nil]
//}
: 構造体の... -
NEWS for Ruby 3
. 0 . 0 (25.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...to StringScanner 3.0.0
* This version is Ractor compatible.
== Compatibility issues
Excluding feature bug fixes.
* Regexp literals and all Range objects are frozen. 8948 16377 15504
//emlist[][ruby]{
/foo/.frozen? #=> true
(42...).frozen? # => true
//}
* EXPERIMENTAL: Hash#each consiste......da's arity check.
* When writing to STDOUT redirected to a closed pipe, no broken pipe error message will be shown now. 14413
* `TRUE`/`FALSE`/`NIL` constants are no longer defined.
* Integer#zero? overrides Numeric#zero? for optimization. 16961
* Enumerable#grep and Enumerable#grep_v when......* `Struct`: reader methods for 10th or later members
* Constant references are inlined.
* Always generate appropriate code for `==`, `nil?`, and `!` calls depending on a receiver class.
* Reduce the number of PC accesses on branches and method returns.
* Optimize C method call...