ライブラリ
- ビルトイン (476)
- delegate (12)
- erb (24)
-
fiddle
/ import (12) - forwardable (48)
- json (24)
- logger (1)
- monitor (12)
- observer (12)
- psych (12)
-
rdoc
/ context (12) - thread (2)
- tracer (24)
- win32ole (24)
クラス
- BasicObject (84)
- Class (48)
- Data (6)
- ERB (24)
- File (12)
- Object (120)
-
RDoc
:: Context (12) - Struct (4)
-
Thread
:: Backtrace :: Location (48) - Tracer (24)
-
WIN32OLE
_ EVENT (12) -
WIN32OLE
_ TYPE (12)
モジュール
- Enumerable (96)
-
Fiddle
:: Importer (12) - Forwardable (48)
- JSON (12)
-
JSON
:: Generator :: GeneratorMethods :: Object (12) - Kernel (12)
- ObjectSpace (36)
キーワード
- ! (12)
- != (12)
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - == (12)
- Application (1)
- BasicObject (12)
- ConditionVariable (12)
- DelegateClass (12)
- Location (12)
- Marshal フォーマット (12)
- MonitorMixin (12)
-
NEWS for Ruby 2
. 0 . 0 (12) -
NEWS for Ruby 2
. 5 . 0 (8) -
NEWS for Ruby 3
. 0 . 0 (5) -
NEWS for Ruby 3
. 1 . 0 (4) - Observable (12)
- Ruby用語集 (12)
- [] (1)
-
_ dump (12) -
absolute
_ path (12) - allocate (12)
-
base
_ label (12) -
cgi
/ session (12) -
create
_ id (12) -
def
_ class (12) -
def
_ delegator (12) -
def
_ instance _ delegator (12) -
default
_ event _ sources (12) - define (6)
-
define
_ finalizer (24) - delegate (12)
-
drb
/ extservm (12) -
drb
/ gw (12) - handler= (12)
-
initialize
_ classes _ and _ modules (12) -
initialize
_ copy (12) - inspect (24)
-
instance
_ delegate (12) -
instance
_ eval (24) -
instance
_ exec (12) -
instance
_ variable _ defined? (12) -
instance
_ variable _ get (12) -
irb
/ completion (12) -
marshal
_ dump (12) - max (48)
-
method
_ missing (12) - min (48)
- new (51)
- path (12)
-
rb
_ class _ initialize (12) - rdoc (12)
-
rdoc
/ generator / json _ index (12) -
rdoc
/ parser (12) -
rexml
/ parsers / streamparser (12) -
ruby 1
. 6 feature (12) -
ruby 1
. 8 . 2 feature (12) -
ruby 1
. 8 . 3 feature (12) -
ruby 1
. 8 . 4 feature (12) -
ruby 1
. 9 feature (12) -
set
_ get _ line _ procs (24) -
singleton
_ method (12) - struct (12)
-
to
_ json (12) -
to
_ s (24) - tsort (12)
-
undefine
_ finalizer (12) - yaml (12)
-
yaml
_ tag (12) - クラス/メソッドの定義 (12)
- パターンマッチ (12)
- 演算子式 (12)
検索結果
先頭5件
-
NEWS for Ruby 3
. 0 . 0 (102.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...d in singleton class definitions in methods is now a SyntaxError
instead of a warning. yield in a class definition outside of a method
is now a SyntaxError instead of a LocalJumpError. 15575
* When a class variable is overtaken by the same definition in an
ancestor class/module, a Run......timeError is now raised (previously,
it only issued a warning in verbose mode). Additionally, accessing a
class variable from the toplevel scope is now a RuntimeError.
14541
* Assigning to a numbered parameter is now a SyntaxError instead of
a warning.
== Command line options
==......el
* Kernel#clone when called with the `freeze: false` keyword will call `#initialize_clone` with the `freeze: false` keyword. 14266
* Kernel#clone when called with the `freeze: true` keyword will call `#initialize_clone` with the `freeze: true` keyword, and will return a frozen copy even if... -
ruby 1
. 8 . 4 feature (102.0) -
ruby 1.8.4 feature ruby 1.8.4 での ruby 1.8.3 からの変更点です。
...* ((<ruby 1.8.4 feature/"Ruby/Tk">))
* ((<ruby 1.8.4 feature/REXML [compat]>))
* ((<ruby 1.8.4 feature/TCPSocket#initialize [bug]>))
* ((<ruby 1.8.4 feature/TCPServer#initialize [bug]>))
* ((<ruby 1.8.4 feature/"optparse">))
* ((<ruby 1.8.4 feature/"find">))
* ((<ruby 1.8.4 feature/Iconv......g eval should preserve external
# information.
: super [bug]
Kernelのメソッド内でsuperを呼んだ時に、存在しないsuperclass
にアクセスしようとするバグの修正。
module Kernel
def foo
super
end
end......tring
: super: no superclass method `foo' (NoMethodError)
from -:7
: 正規表現 [bug]
#Wed Oct 19 01:27:07 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
#
# * regex.c (re_compile_pattern): numeric literal inside character class
# disabled succeeding back... -
ruby 1
. 8 . 3 feature (96.0) -
ruby 1.8.3 feature *((<ruby 1.8 feature>)) *((<ruby 1.8.2 feature>))
...は、$SAFE レベル が 0 のとき
禁止されるようになりました。
$ cat mthd_taint.rb
th = Thread.new{
$SAFE = 3
class Hoge
def foo
puts "safe level: #{$SAFE}"
end
end
}
th.join
p $SAFE
Hoge.new.foo
$ ruby......: Module#class_variable_get [ruby] [new]
: Module#class_variable_set [ruby] [new]
クラスメソッドから((<変数と定数/クラス変数>))にアクセスするための
((<Module#class_variable_get|Module/class_variable_get>)) と
((<Module#class_variable_set|Module/class_variable_......あるという警告は、
オプションに -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#decod... -
NEWS for Ruby 3
. 1 . 0 (66.0) -
NEWS for Ruby 3.1.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...* Class
* 新規メソッド
* Class#subclassesはレシーバを継承した子クラスを要素に持つ配列(シングルトンクラスを含まない)を返します。
//emlist[Class#subclasses][ruby]{
class A; end
class B < A; end
class C < B; end
class D < A; end
A.subclasses......#=> [D, B]
B.subclasses #=> [C]
C.subclasses #=> []
//}
* Enumerable
* 新規メソッド
* Enumerable#compactが追加されました。 17312
* Enumerable#tallyがカウント集計用のハッシュオブジェクトを任意で渡せるようになりました。 1774......ックすることができます。 17795
* Struct
* 新規メソッド
* StructClass#keyword_init? が追加されました。 18008
* 変更されたメソッド
* Struct#initialize はキーワード引数のみを渡すと警告されるようになりました。ハッ... -
ruby 1
. 8 . 2 feature (66.0) -
ruby 1.8.2 feature ruby 1.8.2 での ruby 1.8.1 からの変更点です。
...CGI::Session#initialize [lib] [compat]
'no_hidden' オプションを指定できるようになりました。((<ruby-talk:123850>))
=== 2004-12-16
: Hash#eql? [ruby] [obsolete]
: Hash#hash [ruby] [obsolete]
削除
((<ruby-dev:25206>))?
=== 2004-12-14
: CGI::Session.initialize [lib] [chan......v:24896>))
=== 2004-11-16
: Test::Unit::AutoRunner.options [lib] [compat]
add new option --exclude (-x). ((<ruby-dev:24865>))
: CGI::Session.initialize [lib] [compat]
'sufix' オプションを設定できるようになりました。
=== 2004-11-10
: Array#pack [ruby] [change]
P 指定子......見なされて
いるバグを修正しました。((<ruby-dev:23690>))
$ ruby1.8.1 -e 'class X;end; x=X.new; class << x;p self < X; end'
true
$ ruby1.8.2 -e 'class X;end; x=X.new; class << x;p self < X; end'
nil
=== 2004-06-04
: IO#gets, $_ [ruby] [change]
gets の返り... -
rdoc (54.0)
-
RDoc は Ruby のドキュメント生成を行うためのライブラリです。rdoc という ドキュメント生成のためのコマンドも含んでいます。
...source directory. Default is
the current directory.
: --page-dir dir
Directory where guides, your FAQ or other pages not associated with
a class live. Set this when you don't store such files at your
project root. NOTE: Do not use the same file name in the page dir
and the root of your......。これをオフにしたい場合は all 修飾
子を加えます。
//emlist{
module SM #:nodoc:
class Input
end
end
module Markup #:nodoc: all
class Output
end
end
//}
以上のコードでは、SM::Input のドキュメントのみが出力され......ew:
これはインスタンスメソッドの initialize にのみ適用できます。通常、
RDoc は initialize メソッドのドキュメントやパラメータを実際にはクラス
メソッド new のものと仮定し、initialize の代わりに new を出力しま
す。:no... -
Observable (48.0)
-
Observer パターンを提供するモジュールです。
...バの update メソッドに渡されます。
=== サンプルコード
require "observer"
class Ticker ### Periodically fetch a stock price.
include Observable
def initialize(symbol)
@symbol = symbol
end
def run
last_price = nil
loop do
p......sleep 1
end
end
end
class Price ### A mock class to fetch a stock price (60 - 140).
def self.fetch(symbol)
60 + rand(80)
end
end
class Warner ### An abstract observer of Ticker objects.
def initialize(ticker, limit)
@limit = limit......ticker.add_observer(self)
end
end
class WarnLow < Warner
def update(time, price) # callback for observer
if price < @limit
print "--- #{time.to_s}: Price below #@limit: #{price}\n"
end
end
end
class WarnHigh < Warner
def update(time, price)... -
NEWS for Ruby 2
. 0 . 0 (42.0) -
NEWS for Ruby 2.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...' で始まる使用されていない変数は警告しなくなりました
=== 組み込みクラスの更新
* ARGF.class
* 追加: ARGF.class#codepoints, ARGF.class#each_codepoint
IO にある同名のメソッドに対応します
* Array
* 追加: Array#bsearch 二分探......した。そのようなときは ThreadError が発生します
* Mutex#sleep may spurious wakeup. Check after wakeup.
* NilClass
* 追加: NilClass#to_h 空のハッシュを返します
* ObjectSpace::WeakMap
* 弱い参照を保持するための低レベルのクラスです......ond_to? against a protected method now returns false
unless the second argument is true.
* Object#respond_to_missing?, Object#initialize_clone, Object#initialize_dup
* private になりました
* Thread#join, Thread#value
* 上を参照
* Mutex#lock, Mutex#unlock, Mutex#try_loc... -
ObjectSpace
. # define _ finalizer(obj) {|id| . . . } -> Array (36.0) -
obj が解放されるときに実行されるファイナライザ proc を 登録します。同じオブジェクトについて複数回呼ばれたときは置き換えで はなく追加登録されます。固定値 0 と proc を配列にして返します。
...実行されます。
=== 使い方の注意
以下は、define_finalizer の使い方の悪い例です。
//emlist[悪い例][ruby]{
class Foo
def initialize
ObjectSpace.define_finalizer(self) {
puts "foo"
}
end
end
Foo.new
GC.start
//}
これは、渡された proc の self......キストで Proc を
生成することで上記の問題を回避しています。
//emlist[例][ruby]{
class Bar
def Bar.callback
proc {
puts "bar"
}
end
def initialize
ObjectSpace.define_finalizer(self, Bar.callback)
end
end
Bar.new
GC.start
//}
proc の呼び出し......ちは -d オプションで
事前に例外の発生の有無を確認しておいた方が良いでしょう。
//emlist[例][ruby]{
class Baz
def initialize
ObjectSpace.define_finalizer self, eval(%q{
proc {
raise "baz" rescue puts $!
raise "baz2"
puts "baz3"... -
ObjectSpace
. # define _ finalizer(obj , proc) -> Array (36.0) -
obj が解放されるときに実行されるファイナライザ proc を 登録します。同じオブジェクトについて複数回呼ばれたときは置き換えで はなく追加登録されます。固定値 0 と proc を配列にして返します。
...実行されます。
=== 使い方の注意
以下は、define_finalizer の使い方の悪い例です。
//emlist[悪い例][ruby]{
class Foo
def initialize
ObjectSpace.define_finalizer(self) {
puts "foo"
}
end
end
Foo.new
GC.start
//}
これは、渡された proc の self......キストで Proc を
生成することで上記の問題を回避しています。
//emlist[例][ruby]{
class Bar
def Bar.callback
proc {
puts "bar"
}
end
def initialize
ObjectSpace.define_finalizer(self, Bar.callback)
end
end
Bar.new
GC.start
//}
proc の呼び出し......ちは -d オプションで
事前に例外の発生の有無を確認しておいた方が良いでしょう。
//emlist[例][ruby]{
class Baz
def initialize
ObjectSpace.define_finalizer self, eval(%q{
proc {
raise "baz" rescue puts $!
raise "baz2"
puts "baz3"...