YAML.load fails for Struct objects with non-standard initialize
---------------------------------------------------------------
Key: JRUBY-3751
URL: http://jira.codehaus.org/browse/JRUBY-3751
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules
Affects Versions: JRuby 1.4
Environment: MacOSX 10.5.7
Java(TM) SE Runtime Environment (build 1.6.0_07-b06-153)
Java HotSpot(TM) 64-Bit Server VM (build 1.6.0_07-b06-57, mixed mode)
Reporter: Michael Rykov
Fix For: JRuby 1.4
Attachments: struct_and_yaml.rb
A Struct object that has an initialize with arguments causes YAML.load to fail.
The attached test file has the code along with a few control test cases
{noformat}
$ ruby -v
ruby 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0]
$ ruby ./struct_and_yaml.rb
#<ControlObject:0x18b3ac @arg1="class_value">
#<struct ControlStruct arg1="control_value">
#<struct BadStruct arg1="struct_value">
{noformat}
{noformat}
$ jruby -v
jruby 1.2.0 (ruby 1.8.6 patchlevel 287) (2009-03-16 rev 9419) [i386-java]
$ jruby ./struct_and_yaml.rb
#<ControlObject:0x4814f9 @arg1="class_value">
#<struct ControlStruct arg1="control_value">
./struct_and_yaml.rb:27:in `new': wrong # of arguments(0 for 1) (ArgumentError)
from ./struct_and_yaml.rb:27
{noformat}
{noformat}
$ jruby -v
jruby 1.3.0 (ruby 1.8.6p287) (2009-06-03 5dc2e22) (Java HotSpot(TM) Client VM
1.5.0_16) [i386-java]
$ jruby ./struct_and_yaml.rb
#<ControlObject:0x3cbb4b @arg1="class_value">
#<struct ControlStruct arg1="control_value">
./struct_and_yaml.rb:27:in `new': wrong # of arguments(0 for 1) (ArgumentError)
from ./struct_and_yaml.rb:27
{noformat}
This breaks the *send_later* functionality of *delayed_job* rails plugin
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email