キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) - Marshal フォーマット (11)
-
NEWS for Ruby 2
. 1 . 0 (11) -
NEWS for Ruby 2
. 3 . 0 (9) -
NEWS for Ruby 2
. 5 . 0 (7) -
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) - Ruby用語集 (11)
-
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 2 feature (11) -
ruby 1
. 8 . 3 feature (11) -
ruby 1
. 9 feature (11) - クラス/メソッドの定義 (11)
- セキュリティモデル (11)
検索結果
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (319.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 は
引数チェ......ックがゆるい。break が例外になる。
Proc.new {|a,b,c| p [a,b,c]}.call(1,2)
=> -:1: wrong # of arguments (2 for 3) (ArgumentError)
from -:1:in `call'
from -:1
ruby 1.6.8 (2002-12-24) [i586-lin......nil]
Proc.new { break }.call
=> ruby 1.6.8 (2002-12-24) [i586-linux]
=> -:1:in `call': break from proc-closure (LocalJumpError)
from -:1
ruby 1.8.0 (2003-06-21) [i586-linux]
* lambda および proc が... -
NEWS for Ruby 2
. 7 . 0 (103.0) -
NEWS for Ruby 2.7.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...==== ブロックなしの proc/lambda が deprecated
* ブロック付きで呼び出されたメソッドの中で、ブロックなしでProc.newやKernel#procを
呼び出すと警告が表示されるようになりました。
//emlist[][ruby]{
def foo
proc
end
foo { puts "Hello" }......#=> warning: Capturing the given block using Kernel#proc is deprecated; use `&block` instead
//}
* 非推奨に関する警告を止めたい場合は、コマンドライン引数に
「-W:no-deprecated」を指定するか、コードの中で
「Warning[:deprecated] = false」
と......び出すと
例外が発生するようになりました。
//emlist[][ruby]{
def bar
lambda
end
bar { puts "Hello" } #=> tried to create Proc object without a block (ArgumentError)
//}
==== その他の変更
* 始端なしRangeが実験的に導入されました。
caseやCompara... -
クラス/メソッドの定義 (91.0)
-
クラス/メソッドの定義 * クラス/メソッドの定義: * class * singleton_class * module * method * operator * nest_method * eval_method * singleton_method * class_method * limit * 定義に関する操作: * alias * undef * defined
...Y = 0
WRONLY = 1
end
include Constants
end
File.open("foo", File::RDONLY)
# あるいは
include File::Constants
File.open("foo", RDONLY)
# 上記はあくまでも例である。実際の File.open ではより簡便な
# File.open("foo", "r") という形式が使われる
//}
クラ......が手続きオブジェクト(Proc)としてこの引数に格納されます。これは、
イテレータを定義する方法の一つです。イテレータを定義する代表的な方法は
yield を呼び出すことです。
他に Proc.new/Kernel.#proc を使う方法などもありま......ブロック引数の値はnilです。
//emlist[例][ruby]{
def foo(cnt, &block_arg)
cnt.times { block_arg.call } # ブロックに収まったProcオブジェクトはcallで実行
end
foo(3) { print "Ruby! " } #=> Ruby! Ruby! Ruby!
//}
メソッド定義において、仮引数はその種類... -
ruby 1
. 6 feature (79.0) -
ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。
...dev:17155>))
open("|-","r+") {|f|
if f
f.dup.close_write
else
sleep 1
end
}
=> ruby 1.6.7 (2002-03-01) [i586-linux]
-:3:in `close_write': closing non-duplex IO for writing (IOError)
from -:3
from -:1:in `open'......d>))
サイズが 0 で中身のあるファイル(Linux の /proc ファイルシステムでこ
のような場合があります)が File#read などで読めないバグが修正されまし
た。
p File.open("/proc/#$$/cmdline").read
=> ruby 1.6.7 (2002-03-01) [i586-li......くなりました。((<ruby-bugs-ja:PR#205>))
* ((<Enumerable/each_with_index>)) が self を返すようになった(以前は nil)
* ((<Process/Process.setpgrp>)) が返す値が不定だった。
* ((<String/ljust>)), ((<String/rjust>)), ((<String/center>)) の結果に
変化がな... -
ruby 1
. 9 feature (79.0) -
ruby 1.9 feature ruby version 1.9.0 は開発版です。 以下にあげる機能は将来削除されたり互換性のない仕様変更がなされるかもしれません。 1.9.1 以降は安定版です。 バグ修正がメインになります。
...除
=== 2006-06-11
: __callee__ [new]
: __method__ [new]
((<URL:http://www.dm4lab.to/~usa/ruby/d/200606a.html#id20060610_P1_7>))
: Symbol#to_proc
=== 2006-06-10
* 新機能
: BasicObject が導入されました [new]
: local という visibility および Module#local, Module#local_meth......が 1文字の String を返すようになりました
* 多重代入、引数渡し
: 多重代入や yield の何かが変わりました
: Proc#yield が導入されました
: nil.yield が導入されました。no block given (LocalJumpError) という例外を生成します
: 仮......なる要素の個数を返すように
なりました。
[1,2,3].nitems{|i| i % 2 != 0} #=> 2
((<ruby-talk:134083>))
=== 2005-06-02
: proc [ruby][parser][experimental]
以前のローカル変数に括弧を付けると call が呼び出される変更は取り消されて、
(({(e... -
NEWS for Ruby 2
. 5 . 0 (73.0) -
NEWS for Ruby 2.5.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...ir
* Dir.glob :base というキーワード引数を追加しました 13056
* Dir.chdir (ブロックなしで呼び出した場合), Dir.open, Dir.new, Dir.mkdir, Dir.rmdir,
Dir.empty? はGVLを解放するようになりました
* Dir.children を追加 11302
* Dir.each_c......ようにしました 14123
* Kernel.#warn :uplevel というキーワード引数を追加しました 12882
* Method
* Method#=== は Proc#===と同じようにMethod#callを呼び出します 14142
* Module
* Module#attr, Module#attr_accessor, Module#attr_reader, Module#attr_w......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... -
NEWS for Ruby 3
. 0 . 0 (73.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])......be compatible for essentially all usages and avoids blocking when using a scheduler. 16792
* Proc
* Proc#== and Proc#eql? are now defined and will return true for separate Proc instances if the procs were created from the same block. 14267
* Queue / SizedQueue
* Queue#pop, SizedQueue#pu......ring#succ / String#next
* String#swapcase
* String#tr
* String#tr_s
* String#upcase
* Symbol
* Symbol#to_proc now returns a lambda Proc. 16260
* Symbol#name has been added, which returns the name of the symbol if it is named. The returned string is frozen. 16150... -
NEWS for Ruby 2
. 3 . 0 (55.0) -
NEWS for Ruby 2.3.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...#fetch_values を追加
10017
* Hash#dig を追加
11643
* Hash#<=, Hash#<, Hash#>=, Hash#> を追加
10984
* Hash#to_proc を追加
11653
* IO
* 新しいフラグ File::SHARE_DELETE(File::Constants::SHARE_DELETE) が使用できます。
Windows で......NameError#receiver を追加
10881
* Numeric
* Numeric#positive?, Numeric#negative? を追加
11151
* Proc
* Proc#call ( Proc#[] , Proc#===, Proc#yield) は最適化されました。
Backtrace doesn't show each method (show block lines directly).
TracePoint al......るようになりました。
11444
* Module
* Module#define_method と Object#define_singleton_method は
メソッド本体(Procオブジェクト、Methodオブジェクト、またはブロック )が必須になりました。
ブロックが与えられない場合は... -
ruby 1
. 8 . 3 feature (55.0) -
ruby 1.8.3 feature *((<ruby 1.8 feature>)) *((<ruby 1.8.2 feature>))
...-09-10
: OpenSSL::PKCS7::RecipientInfo [lib] [new]
: OpenSSL::PKCS7::SignerInfo [lib] [compat]
新クラス、追加。OpenSSL::PKCS7::Signer が OpenSSL::PKCS7::SignerInfo に名前が変わりました。Signer も別名として
引続き提供されます。
=== 2005-09-10
: OpenSSL::Di......gest::SHA224
: OpenSSL::Digest::SHA256
: OpenSSL::Digest::SHA384
: OpenSSL::Digest::SHA512
新クラス、追加。OpenSSL 0.9.8 以降とともにコンパイルされた時のみ。
=== 2005-09-09
: $SAFE [ruby] [compat]
メソッドが定義された時の $SAFE レベルを記憶するよ......s
p d.entries
'
[]
$ ruby-1.8.3 -e '
d = Dir.new("/")
d.entries
p d.entries
'
[".", "..", "dev", "home", "proc", "var", "tmp", "etc", "usr", "sbin", "bin", "boot"]
=== 2005-07-11
: 正規表現 [ruby] [bug]
正規表現リテラル中で \c\\ 表記が... -
Ruby用語集 (49.0)
-
Ruby用語集 A B C D E F G I J M N O R S Y
...し、切り替えて使うための
ツールの一つ。Linux、macOS などで動作する。
https://github.com/rbenv/rbenv
: RD(Ruby Document format)
Ruby スクリプト中に記述することを念頭に作られたドキュメントフォーマット。
: RDoc
Ruby スクリ......オブジェクトの仮引数の数、および
ブロックやそれをオブジェクト化した Proc オブジェクトの
ブロックパラメーターの数。
Method#arity や Proc#arity で得ることができる。
引数などの数が 1 個、2 個、3 個であることを......存在する。
オブジェクト空間に関する情報は ObjectSpace クラスで得ることが
できる。
: オープンクラス
: open class
組込みのクラスが再定義可能であること。
Ruby は String や Integer といった基本的なクラスも自由に改変... -
Marshal フォーマット (37.0)
-
Marshal フォーマット フォーマットバージョン 4.8 を元に記述しています。
...e => false, false => true, nil => nil}).unpack("x2 a c aa aa aa")
# => ["{", 8, "T", "F", "F", "T", "0", "0"]
//}
==== Hash with default value (not Proc)
'}' で始まるデータ構造になります。
//emlist{
| '}' | 要素数(Fixnum形式) | キーの dump | 値の dump | ... | デフォル......}", 6, "i", 15, "i", 25, "i", 0]
//}
==== Hash with default_proc
default_proc が設定されている Hash は dump できません。
//emlist[][ruby]{
h = Hash.new { }
Marshal.dump(h)
# => TypeError (can't dump hash with default proc)
//}
=== Struct
構造体クラスのインスタンスの......ラス/モジュールのインスタンス変数は dump されない][ruby]{
module Bar
@bar = 1
end
p Bar.instance_eval { @bar } # => 1
File.open('testfile', 'wb') do |f|
Marshal.dump(Bar, f)
end
# 別プログラム相当にするため remove_const
Object.send :remove_const, :Bar
module B...