[#65451] [ruby-trunk - Feature #10333] [PATCH 3/1] optimize: "yoda literal" == string — ko1@...
Issue #10333 has been updated by Koichi Sasada.
ko1@atdot.net wrote:
Eric Wong <normalperson@yhbt.net> wrote:
Eric Wong <normalperson@yhbt.net> wrote:
On 2014/10/09 11:04, Eric Wong wrote:
SASADA Koichi <ko1@atdot.net> wrote:
[#65453] [ruby-trunk - Feature #10328] [PATCH] make OPT_SUPPORT_JOKE a proper VM option — ko1@...
Issue #10328 has been updated by Koichi Sasada.
[#65559] is there a name for this? — Xavier Noria <fxn@...>
When describing stuff about constants (working in their guide), you often
On 2014/10/09 20:41, Xavier Noria wrote:
On Thu, Oct 9, 2014 at 1:59 PM, Nobuyoshi Nakada <nobu@ruby-lang.org> wrote:
[#65566] [ruby-trunk - Feature #10351] [Open] [PATCH] prevent CVE-2014-6277 — shyouhei@...
Issue #10351 has been reported by Shyouhei Urabe.
[#65741] Re: [ruby-cvs:55121] normal:r47971 (trunk): test/ruby/test_rubyoptions.rb: fix race — Nobuyoshi Nakada <nobu@...>
On 2014/10/16 10:10, normal@ruby-lang.org wrote:
Nobuyoshi Nakada <nobu@ruby-lang.org> wrote:
2014-10-16 12:48 GMT+09:00 Eric Wong <normalperson@yhbt.net>:
[#65753] [ruby-trunk - Feature #10333] [PATCH 3/1] optimize: "yoda literal" == string — ko1@...
Issue #10333 has been updated by Koichi Sasada.
[#65818] [ruby-trunk - Feature #10351] [PATCH] prevent CVE-2014-6277 — shyouhei@...
Issue #10351 has been updated by Shyouhei Urabe.
[ruby-core:65853] [ruby-trunk - Bug #9005] object.send(:define_method, ...){...} creates private method
Issue #9005 has been updated by Scott Tamosunas.
This isn't fixed on 2.1.3. Has that changeset not made it into a release?
`2.1.3 :001 > RUBY_VERSION
=> "2.1.3"
2.1.3 :002 > class Foo
2.1.3 :003?>
2.1.3 :004 > private
2.1.3 :005?>
2.1.3 :006 > define_method("bar") { puts "BAR" }
2.1.3 :007?> end
=> :bar
2.1.3 :008 >
2.1.3 :009 > Foo.new.bar
NoMethodError: private method `bar' called for #<Foo:0x007ff90b8e3198>
from (irb):9
from /Users/me/.rvm/rubies/ruby-2.1.3/bin/irb:11:in `<main>'`
Where this works on 2.0
`2.0.0-p451 :001 > RUBY_VERSION
=> "2.0.0"
2.0.0-p451 :002 > class Foo
2.0.0-p451 :003?>
2.0.0-p451 :004 > private
2.0.0-p451 :005?>
2.0.0-p451 :006 > define_method("bar") { puts "BAR" }
2.0.0-p451 :007?> end
=> #<Proc:0x0000010103cd00@(irb):6 (lambda)>
2.0.0-p451 :008 >
2.0.0-p451 :009 > Foo.new.bar
BAR
`
----------------------------------------
Bug #9005: object.send(:define_method, ...){...} creates private method
https://bugs.ruby-lang.org/issues/9005#change-49587
* Author: Jeremy Evans
* Status: Closed
* Priority: Normal
* Assignee: Nobuyoshi Nakada
* Category: core
* Target version: 2.1.0
* ruby -v: ruby 2.1.0dev (2013-09-22 trunk 43011) [i386-openbsd]
* Backport: 1.9.3: DONTNEED, 2.0.0: DONTNEED, 2.1.0: REQUIRED
----------------------------------------
I assume this is caused by r40022, which made define_method consider visibility. However, visibility should only be considered if define_method is called normally, not via send. When called via send, it should define a public method. Here's example code showing the error:
$ ruby21 -ve "Object.send(:define_method, :foo){|*a| 1}.foo"
-e:1:in `<main>': private method `foo' called for :foo:Symbol (NoMethodError)
I apologize in advance if this has already been fixed (I tested 2.1.0-preview1, not trunk), but from the commit logs it doesn't appear to have been.
--
https://bugs.ruby-lang.org/