[#45703] test_advise failure on GNU/Linux — Tanaka Akira <tanaka.akira@...>

今朝、気がついたのですが、手元で test_advise が失敗します。

11 messages 2012/06/05
[#45705] Re: test_advise failure on GNU/Linux — KOSAKI Motohiro <kosaki.motohiro@...> 2012/06/06

小崎です

[#45735] [ruby-trunk - Feature #6587][Open] proposal: adding new methods File.rootname and Pathname#rootname — "usa (Usaku NAKAMURA)" <usa@...>

14 messages 2012/06/14

[#45745] Re: [ruby-changes:24028] yugui:r36079 (trunk): Embedding CRuby interpreter without internal headers has been difficult — SASADA Koichi <ko1@...>

見逃していました.

19 messages 2012/06/14
[#45747] Re: [ruby-changes:24028] yugui:r36079 (trunk): Embedding CRuby interpreter without internal headers has been difficult — Yugui <yugui@...> 2012/06/15

2012/6/15 SASADA Koichi <ko1@atdot.net>:

[#45748] Re: [ruby-changes:24028] yugui:r36079 (trunk): Embedding CRuby interpreter without internal headers has been difficult — SASADA Koichi <ko1@...> 2012/06/15

 ささだです.

[#45794] :new_pgroup and :pgroup option for spawn. — Tanaka Akira <akr@...>

process.c で気がついたのですが、spawn に Windows 用の :new_pgroup というオプションが

12 messages 2012/06/23
[#45800] Re: :new_pgroup and :pgroup option for spawn. — "U.Nakamura" <usa@...> 2012/06/25

こんにちは、なかむら(う)です。

[#45818] [ruby-trunk - Feature #6643][Open] io.seek(off, :end) — "akr (Akira Tanaka)" <akr@...>

30 messages 2012/06/25

[ruby-dev:45856] [ruby-trunk - Bug #5776] irb のトップレベルで定義したメソッドが public になる

From: "davidbalbert (David Albert)" <davidbalbert@...>
Date: 2012-06-26 23:06:15 UTC
List: ruby-dev #45856
Issue #5776 has been updated by davidbalbert (David Albert).

File 0001-make-top-level-methods-defined-in-IRB-private.patch added

I ran into this bug recently and I did a bit of investigating. This is due to a change introduced by #3406 (r29578) that made inner method definitions public regardless of the visibility of the method they were defined in.

I've attached a patch that calls `private` in the `irb_binding` method before returning the binding, which fixes the problem. I also verified that context mode 3 was the only mode affected by r29578 and that IRB works correctly when started via the command line and via `IRB.start`.
----------------------------------------
Bug #5776: irb のトップレベルで定義したメソッドが public になる
https://bugs.ruby-lang.org/issues/5776#change-27503

Author: hibariya (hi hibariya)
Status: Assigned
Priority: Normal
Assignee: keiju (Keiju Ishitsuka)
Category: lib
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2011-12-15 trunk 34056) [x86_64-darwin11.2.0] 


irb のトップレベルで定義したメソッドの呼び出し制限が private ではなく public になってしまいます。

-------------------------------------------------
 irb(main):001:0> def greeting
 irb(main):002:1>   'hi'
 irb(main):003:1> end
 => nil
 irb(main):004:0> val = Object.new
 => #<Object:0x007fe6ca05fd80>
 irb(main):005:0> val.greeting
 => "hi"
 irb(main):006:0> val.private_methods.grep /greeting/
 => []
 irb(main):007:0> val.public_methods.grep /greeting/
 => [:greeting]
-------------------------------------------------

public になるのは irb で実行したときのみです(ファイルに保存して ruby コマンドで実行した場合は private メソッドとして定義されます)。


-- 
http://bugs.ruby-lang.org/

In This Thread

Prev Next