Forum: JRuby Kernel#__method__

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Andrea F. (Guest)
on 2009-05-20 02:05
(Received via mailing list)
Hi all,

it seems that Kernel#__method__ is not implemented in jruby.

irb(main):001:0> __method__
NameError: undefined local variable or method `__method__' for
main:Object

Am I missing something?

Thanks.
Andrea



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Tim P. (Guest)
on 2009-05-20 02:12
(Received via mailing list)
On Tue, May 19, 2009 at 4:05 PM, Andrea F. 
<removed_email_address@domain.invalid>
wrote:
> Hi all,
>
> it seems that Kernel#__method__ is not implemented in jruby.
>
> irb(main):001:0> __method__
> NameError: undefined local variable or method `__method__' for main:Object
>
> Am I missing something?
>

__method__ is a feature from Ruby 1.9

You'll need to run JRuby in 1.9 compatible mode. It defaults to Ruby 1.8
syntax.

-> jruby --1.9 -S irb
irb(main):001:0> __method__
=> :irb_binding
irb(main:002:0>

Blessings,
TwP

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Andrea F. (Guest)
on 2009-05-20 02:24
(Received via mailing list)
Il giorno mar, 19/05/2009 alle 16.11 -0600, Tim P. ha scritto:
> __method__ is a feature from Ruby 1.9

Hi Tim,

it seems that the feature is present since 1.8.7:

andrea@ganimoide:~/src$ ruby --version
ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux]
andrea@ganimoide:~/src/johnson-ffi-stable$ irb
>> __method__
=> :irb_binding

Andrea



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Shot (Piotr S.) (Guest)
on 2009-05-20 04:24
(Received via mailing list)
Andrea F.:

> Il giorno mar, 19/05/2009 alle 16.11 -0600, Tim P. ha scritto:

>> __method__ is a feature from Ruby 1.9

> it seems that the feature is present since 1.8.7:

> andrea@ganimoide:~/src$ ruby --version
> ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux]
> andrea@ganimoide:~/src/johnson-ffi-stable$ irb
> >> __method__
> => :irb_binding

As far as I understand, JRuby is striving for 1.8.6 (and 1.9)
compatibility and skips 1.8.7 altogether (at least for now).

— Shot
Charles Oliver N. (Guest)
on 2009-05-20 07:03
(Received via mailing list)
Shot (Piotr S.) wrote:
> As far as I understand, JRuby is striving for 1.8.6 (and 1.9)
> compatibility and skips 1.8.7 altogether (at least for now).

I think we're going to flip the switch on 1.8.7 for JRuby 1.4, since
most of it is there (because of 1.9 support) and we're getting more and
more people asking about those missing features.

- Charlie

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
This topic is locked and can not be replied to.