request.to_yaml fails (jruby-rack 1.0.3 issue)
----------------------------------------------

                 Key: JRUBY-5162
                 URL: http://jira.codehaus.org/browse/JRUBY-5162
             Project: JRuby
          Issue Type: Bug
         Environment: reproduced on Solaris 11 as well as on Ubuntu Linux 10.04 
(JRuby 1.5.2 + JRuby Rack 1.0.3 + Rails 2.3.8)
            Reporter: Karol Bucek
            Assignee: Thomas E Enebo
            Priority: Minor


invoking *request.to_yaml* fails with :

{code}
 can't dump anonymous class Class
 yaml/rubytypes:56:in `to_yaml'
 yaml/rubytypes:56:in `to_yaml'
 yaml/rubytypes:160:in `to_yaml'
 yaml/rubytypes:159:in `each'
 yaml/rubytypes:159:in `to_yaml'
 yaml/rubytypes:158:in `seq'
 yaml/rubytypes:158:in `to_yaml'
 yaml:388:in `emit'
 yaml:388:in `quick_emit'
 yaml/rubytypes:157:in `to_yaml'
 yaml/rubytypes:68:in `to_yaml'
 yaml/rubytypes:67:in `each'
 yaml/rubytypes:67:in `to_yaml'
 yaml/rubytypes:66:in `map'
 yaml/rubytypes:66:in `to_yaml'
 yaml:388:in `emit'
 yaml:388:in `quick_emit'
 yaml/rubytypes:65:in `to_yaml'
 yaml/rubytypes:91:in `to_yaml'
 yaml/rubytypes:90:in `each'
 yaml/rubytypes:90:in `to_yaml'
 yaml/rubytypes:89:in `map'
 yaml/rubytypes:89:in `to_yaml'
 yaml:388:in `emit'
 yaml:388:in `quick_emit'
 yaml/rubytypes:88:in `to_yaml'
 yaml/rubytypes:68:in `to_yaml'
 yaml/rubytypes:67:in `each'
 yaml/rubytypes:67:in `to_yaml'
 yaml/rubytypes:66:in `map'
 yaml/rubytypes:66:in `to_yaml'
 yaml:388:in `emit'
 yaml:388:in `quick_emit'
 yaml/rubytypes:65:in `to_yaml'
 yaml/rubytypes:160:in `to_yaml'
 yaml/rubytypes:159:in `each'
 yaml/rubytypes:159:in `to_yaml'
 yaml/rubytypes:158:in `seq'
 yaml/rubytypes:158:in `to_yaml'
 yaml:388:in `emit'
 yaml:388:in `quick_emit'
 yaml/rubytypes:157:in `to_yaml'
 yaml/rubytypes:68:in `to_yaml'
 yaml/rubytypes:67:in `each'
 yaml/rubytypes:67:in `to_yaml'
 yaml/rubytypes:66:in `map'
 yaml/rubytypes:66:in `to_yaml'
 yaml:388:in `emit'
 yaml:388:in `quick_emit'
 yaml/rubytypes:65:in `to_yaml'
 yaml/rubytypes:68:in `to_yaml'
 yaml/rubytypes:67:in `each'
 yaml/rubytypes:67:in `to_yaml'
 yaml/rubytypes:66:in `map'
 yaml/rubytypes:66:in `to_yaml'
 yaml:388:in `emit'
 yaml:388:in `quick_emit'
 yaml/rubytypes:65:in `to_yaml'
 yaml/rubytypes:91:in `to_yaml'
 yaml/rubytypes:90:in `each'
 yaml/rubytypes:90:in `to_yaml'
 yaml/rubytypes:89:in `map'
 yaml/rubytypes:89:in `to_yaml'
 yaml:388:in `emit'
 yaml:388:in `quick_emit'
 yaml/rubytypes:88:in `to_yaml'
 yaml/rubytypes:68:in `to_yaml'
 yaml/rubytypes:67:in `each'
 yaml/rubytypes:67:in `to_yaml'
 yaml/rubytypes:66:in `map'
 yaml/rubytypes:66:in `to_yaml'
 yaml:388:in `emit'
 yaml:388:in `quick_emit'
 yaml/rubytypes:65:in `to_yaml'
 yaml/rubytypes:160:in `to_yaml'
 yaml/rubytypes:159:in `each'
 yaml/rubytypes:159:in `to_yaml'
 yaml/rubytypes:158:in `seq'
 yaml/rubytypes:158:in `to_yaml'
 yaml:388:in `emit'
 yaml:388:in `quick_emit'
 yaml/rubytypes:157:in `to_yaml'
 yaml/rubytypes:142:in `to_yaml'
 yaml/rubytypes:141:in `each'
 yaml/rubytypes:141:in `to_yaml'
 yaml/rubytypes:140:in `map'
 yaml/rubytypes:140:in `to_yaml'
 yaml:388:in `emit'
 yaml:388:in `quick_emit'
 yaml/rubytypes:136:in `to_yaml'
{code}

seems to be caused by entries in the *...@env* hash - this custom to_yaml 
eliminates the issue :

{code}
  def to_yaml( opts = {} )
    YAML::quick_emit( self, opts ) do |out|
      out.map( taguri, to_yaml_style ) do |map|
        to_yaml_properties.each do |prop|
          value = instance_variable_get( prop )

          if prop.to_sym == :'@env'
            value = value.dup # Hash
            value.delete('action_controller.rescue.request')
            value.delete('action_controller.rescue.response')
          end
          
          map.add( prop[1..-1], value )
        end
      end
    end
  end
{code}


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