Is class_variable_set a private method?

Hi all,

I found a difference between JRuby and Ruby.
The following is a log on my Windows 7.

Is this a known difference between ruby version (1.9.2p312 and
1.9.3p125)?
Is class_variable_set a private method in JRuby?


C:\tmp>cat test.rb
class A; end
A.class_variable_set :@@a, 1
p A.class_variable_get :@@a

C:\tmp>ruby -v
ruby 1.9.3p125 (2012-02-16) [i386-mingw32]

C:\tmp>ruby test.rb
1

C:\tmp>jruby --1.9 -v
jruby 1.6.6 (ruby-1.9.2-p312) (2012-01-30 5673572) (Java HotSpot™
Client VM 1
.6.0_29) [Windows 7-x86-java]

C:\tmp>jruby --1.9 test.rb
NoMethodError: private method `class_variable_set’ called for A:Class
(root) at test.rb:2

ashbb

It happened at some point during 1.9 development. 1.9.2 seems to have
it public. Maybe between 1.9.1 and 1.9.2?

JRuby has already fixed this on master and the upcoming JRuby 1.6.7
(due out very very soon) will also fix this visibility issue.

-Tom

On Tue, Feb 21, 2012 at 7:38 AM, ashbb shoeser [email protected]
wrote:

C:\tmp>cat test.rb
C:\tmp>jruby --1.9 -v


Posted via http://www.ruby-forum.com/.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


blog: http://blog.enebo.com twitter: tom_enebo
mail: [email protected]

Hi Tom,

JRuby has already fixed this on master and the upcoming JRuby 1.6.7
(due out very very soon) will also fix this visibility issue.
Fantastic!
Thank you for letting me know. I’ll wait for the next release!

Regards,
ashbb