キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) - Marshal フォーマット (11)
-
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 1 . 0 (11) -
NEWS for Ruby 2
. 6 . 0 (6) -
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) -
NEWS for Ruby 3
. 1 . 0 (3) - Ruby プログラムの実行 (11)
-
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 2 feature (11) -
ruby 1
. 8 . 4 feature (11) -
ruby 1
. 9 feature (11) - オブジェクト指向スクリプト言語 Ruby リファレンスマニュアル (11)
- クラス/メソッドの定義 (11)
- セキュリティモデル (11)
- プログラム・文・式 (11)
- リテラル (11)
検索結果
-
Ruby プログラムの実行 (3079.0)
-
Ruby プログラムの実行 === Ruby プログラム
...ss を継承します。Module#module_eval/class_eval、
BasicObject#instance_eval
の三つだけが例外で、以下のように変更されます。
: Module#module_eval, Module#class_eval
self、class ともそのレシーバ
: BasicObject#instance_eval
self がそのレシーバ、cla......ss がそのレシーバの特異クラス
==== eval
eval の第二引数に Proc オブジェクトまたは Binding オブ
ジェクトを与えたときは、その生成時のブロックのうえで文字列を評価します。
==== メソッドの実行
メソッドの実行はフレー......にないなら例外 LocalJumpError
を発生します。
next ブロックの終わりまでジャンプ
retry 複雑だ…
==== eval, instance_eval, module_eval
これなんだっけ
=== 代入
代入とは、変数・定数のいずれかにオブジェクトを記憶させることを言... -
ruby 1
. 8 . 4 feature (91.0) -
ruby 1.8.4 feature ruby 1.8.4 での ruby 1.8.3 からの変更点です。
...1.8.4 (2005-12-22) [i686-linux]
:foo!
:bar?
4) :$- always treats next character literally:
p eval(":$-\n") # => :"$-\n"
p :$-( # => :"$-("
p :$- # => :"$- "
p :$-#.object_id # => 3950350
# => ru......Nov 1 14:20:11 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
#
# * eval.c (rb_call_super): should call method_missing if super is
# called from Kernel method.
#
# * eval.c (exec_under): frame during eval should preserve external
# information.
: super [bug]
Kerne......サンプル兼ライブラリ
#Wed Dec 7 01:02:04 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
#
# * ext/tk/README.macosx-aqua: [new document] tips to avoid the known
# bug on platform specific dialogs of Tcl/Tk Aqua on MacOS X.
MacOS X 上で Aqua 版の Tcl/Tk を用いた... -
ruby 1
. 6 feature (49.0) -
ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。
...が定義されていない場合例外 NameError を起こ
すようになりました。((<ruby-bugs-ja:PR#216>))
Object.new.instance_eval {
p remove_instance_variable :@foo
}
=> ruby 1.6.7 (2002-03-01) [i586-linux]
nil
=> -:2:in `remove_ins......ule_eval>))
((<Module/module_eval>)) のブロック内で定数やクラス変数のスコープが
変わることはなくなりました。((<ruby-dev:17876>))
class Foo
FOO = 1
@@foo = 1
end
FOO = 2
@@foo = 2
Foo.module_eval {......v:14942>))
Module.constants.each {|c|
c = eval c
if c.instance_of?(Class)
p c
c.instance_methods.each {|m|
c.module_eval "undef #{m};"
}
c.module_eval {undef initialize}
end
}
=> rub... -
NEWS for Ruby 2
. 1 . 0 (31.0) -
NEWS for Ruby 2.1.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...無視します。
* Kernel.#eval, Kernel.#instance_eval, Module#module_eval
元の環境のスコープ情報をコピーするようになりました。これは、引数なしの
private, protected, public, module_function を文字列として eval しても
その外側には影......響を与えないという意味です。
以下のコードは Foo#foo をプライベートにしません。
//emlist{
class Foo
eval "private"
def foo
end
end
//}
* Object#untrusted?,Object#untrust,Object#trust
* これらのメソッドは非推奨になり... -
クラス/メソッドの定義 (29.0)
-
クラス/メソッドの定義 * クラス/メソッドの定義: * class * singleton_class * module * method * operator * nest_method * eval_method * singleton_method * class_method * limit * 定義に関する操作: * alias * undef * defined
...の定義
* クラス/メソッドの定義:
* class
* singleton_class
* module
* method
* operator
* nest_method
* eval_method
* singleton_method
* class_method
* limit
* 定義に関する操作:
* alias
* undef
* defined
===[a:class] ク......# => warning: method redefined; discarding old bar
Foo.new.bar # => :bar (他のインスタンスでも定義済み)
//}
====[a:eval_method] メソッドの評価
メソッドが呼び出されると、以下の順で式が評価されます。
* 指定されていれば引数......定されたメソッドは、そのメソッドを持つオブジェクトが
selfであるコンテキスト(メソッド定義式やinstance_eval)でのみ呼び出せ
ます。
//emlist[例: protected の可視性][ruby]{
class Foo
def foo
p caller.last
end
protected :foo
end
ob... -
NEWS for Ruby 3
. 0 . 0 (25.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...sent and has
a non-empty value, and the standard input and output are tty, the `--help`
option shows the help message via the pager designated by the value.
16754
=== `--backtrace-limit` option
The `--backtrace-limit` option limits the maximum length of a backtrace.
8661
== Core classes updates......ep(2)] # take each second element
# => ["data1", "data2", "data3"]
//}
* Binding
* Binding#eval when called with one argument will use `"(eval)"` for `__FILE__` and `1` for `__LINE__` in the evaluated code. 4352 17419
* ConditionVariable
* ConditionVariable#wait may now invoke the `bloc......true` keyword, and will return a frozen copy even if the receiver is unfrozen. 16175
* Kernel#eval when called with two arguments will use `"(eval)"` for `__FILE__` and `1` for `__LINE__` in the evaluated code. 4352
* Kernel#lambda now warns if called without a literal block. 15973
* Ker... -
Marshal フォーマット (19.0)
-
Marshal フォーマット フォーマットバージョン 4.8 を元に記述しています。
...= 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 Bar
end
p bar = Marshal.load(File.binread('testfile'))
p bar.instance_eval { @bar }
# => nil
//}......hal_format#Object 参照)
この形式は、Array や String のインスタンス用です。
//emlist[例][ruby]{
obj = String.new
obj.instance_eval { @foo = :bar }
p Marshal.dump(obj).unpack("x2 a ac c a c a4 aca*")
# => ["I", "\"", 0, 6, ":", 9, "@foo", ":", 8, "bar"]
//}
クラスやモジ... -
NEWS for Ruby 2
. 6 . 0 (19.0) -
NEWS for Ruby 2.6.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...__ と __LINE__ の二要素配列として返します。
従来でも eval("[__FILE__, __LINE__]", binding) とすることでこれらの情報は得られましたが、
将来的に Kernel.#eval は binding のソースコード行を無視する変更を予定している......れました。 15287
* 新規メソッド
* TracePoint#parameters 14694
* TracePoint#instruction_sequence 15287
* TracePoint#eval_script 15287
* 変更されたメソッド
* TracePoint#enable がキーワード引数 "target:" と "target_line:" を
受け......をサポート
* いくつかの XPath 実装を修正:
* "//#{ELEMENT_NAME}[#{POSITION}]" の問題
* string() 関数: function(document) がルート要素の外のノードを返すのを修正
* "/ #{ELEMENT_NAME} " の問題
* "/ #{ELEMENT_NAME} [ #{PREDICATE} ]"... -
ruby 1
. 9 feature (13.0) -
ruby 1.9 feature ruby version 1.9.0 は開発版です。 以下にあげる機能は将来削除されたり互換性のない仕様変更がなされるかもしれません。 1.9.1 以降は安定版です。 バグ修正がメインになります。
...=== 2006-03-03
: FileUtils.cp_r [lib] [compat]
remove_destination オプションの追加
((<ruby-dev:28417>))
=== 2006-02-15
: instance_eval
((<ruby-core:7365>))
=== 2006-02-03
: Integer#upto [compat]
: Integer#downto [compat]
: Integer#doitems [compat]
ブロックがなけ......ruby-dev:24255>))
=== 2004-08-27
: StringIO#readpartial(maxlen[, outbuf]) [lib][new]
追加。((<ruby-dev:24061>))
=== 2004-08-19
: Binding#eval(expr[, fname[, lineno=1]]) [new]
追加。((<RCR#251>))
: String#clear [new]
追加。((<ruby-dev:24104>))
=== 2004-08-17
: Process... -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (7.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への変更点(まとめ)/サポートプラットフォームの追加>))
...END__ は、スクリプトの終りとみなさなくな
りました。((<ruby-dev:17513>))
# p "
#__END__
#"
p eval(%Q(p "\n__END__\n"))
: ((<?<whitespace>|リテラル/数値リテラル>)) [parser] [change]
?スペース、?改行、?TAB 等はリテラル... -
NEWS for Ruby 2
. 0 . 0 (7.0) -
NEWS for Ruby 2.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...:
* added main.define_method which defines a global function.
* added main.using, which imports refinements into the current file or
eval string. [experimental]
=== 組み込みクラスの互換性 (機能追加とバグ修正を除く)
* Array#values_at
上を参照......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. Constructing such values is still
permitt......olv
* 追加: Resolv::DNS#timeouts=
* 追加: Resolv::DNS::Config#timeouts=
* rexml
* REXML::Document#write はハッシュ引数をサポートしました
* REXML::Document#write は :encoding オプションをサポートしました。
XMLドキュメントのエンコ...