to_yaml method broken on Floats when ActiveSupport is required
--------------------------------------------------------------

                 Key: JRUBY-3506
                 URL: http://jira.codehaus.org/browse/JRUBY-3506
             Project: JRuby
          Issue Type: Bug
          Components: Miscellaneous
    Affects Versions: JRuby 1.1.6, JRuby 1.2
         Environment: Mac OS X, Java 1.6, ActiveSupport 2.3.2
            Reporter: John Wunder


The ActiveSupport extensions for BigDecimal are breaking the .to_yaml method 
for floats.

To reproduce:

~/Projects/cds$ jirb
irb(main):001:0> require 'yaml'
=> true
irb(main):002:0> (10.0).to_yaml
=> "--- 10.0\n"
irb(main):003:0> require 'rubygems'
=> true
irb(main):004:0> require 'activesupport'
=> true
irb(main):005:0> (10.0).to_yaml         
=> "--- !float:Float 10.0\n"

It works in MRI IRB:
~$ irb
irb(main):001:0> (10.0).to_yaml
=> "--- 10.0\n"
irb(main):002:0> require 'yaml'
=> false
irb(main):003:0> require 'activesupport'
(1=> true
irb(main):004:0> (10.0).to_yaml
=> "--- 10.0\n"

Somehow it's related to how ActiveSupport calls "yaml_as YAML_TAG" for 
BigDecimal in the Core Extensions 
(ActiveSupport::CoreExtensions::BigDecimal::Conversions).

I figure this is a JRuby bug and not ActiveSupport because it doesn't happen in 
MRI, but I could be wrong.

-- 
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


Reply via email to