Empact / roxml

ROXML is a module for binding Ruby classes to XML. It supports custom mapping and bidirectional marshalling between Ruby and XML using annotation-style class methods, via Nokogiri or LibXML.
http://roxml.rubyforge.org/
MIT License
224 stars 178 forks source link

Mongrel + Rails 2.3.1 interaction? #6

Closed Empact closed 14 years ago

Empact commented 15 years ago

Reported by James Healy:

On an unrelated note, I'm seeing an odd interation with ROXML 2.5.1 and rails 2.3.1. I've got a test branch where I'm trying out my app on rails 2.3.1, and mongrel is refusing to boot since I started using 2.5.1. Everything still works as expected with rails 2.2.2.

=> Booting Mongrel => Rails 2.3.1 application starting on http://0.0.0.0:3000 /var/lib/gems/1.8/gems/roxml-2.5.1/lib/roxml/definition.rb:48:in try': undefined methodxml_name_without_deprecation?' for :text:Symbol (NoMethodError) from /var/lib/gems/1.8/gems/roxml-2.5.1/lib/roxml/definition.rb:48:in initialize' from /var/lib/gems/1.8/gems/roxml-2.5.1/lib/roxml.rb:445:innew' from /var/lib/gems/1.8/gems/roxml-2.5.1/lib/roxml.rb:445:in xml_attr' from /var/lib/gems/1.8/gems/roxml-2.5.1/lib/roxml.rb:474:inxml_accessor' from /var/lib/gems/1.8/gems/onix-0.5.1/lib/onix/sender_identifier.rb:7 from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require' from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:inrequire' from /var/lib/gems/1.8/gems/activesupport-2.3.1/lib/active_support/dependencies.rb:156:in require' from /var/lib/gems/1.8/gems/activesupport-2.3.1/lib/active_support/dependencies.rb:521:innew_constants_in' from /var/lib/gems/1.8/gems/activesupport-2.3.1/lib/active_support/dependencies.rb:156:in require' from /var/lib/gems/1.8/gems/onix-0.5.1/lib/onix.rb:65 from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:ingem_original_require' from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in require' from /var/lib/gems/1.8/gems/activesupport-2.3.1/lib/active_support/dependencies.rb:156:inrequire' from /var/lib/gems/1.8/gems/activesupport-2.3.1/lib/active_support/dependencies.rb:521:in new_constants_in' from /var/lib/gems/1.8/gems/activesupport-2.3.1/lib/active_support/dependencies.rb:156:inrequire' from /var/lib/gems/1.8/gems/rails-2.3.1/lib/rails/gem_dependency.rb:96:in load' from /var/lib/gems/1.8/gems/rails-2.3.1/lib/initializer.rb:304:inload_gems' from /var/lib/gems/1.8/gems/rails-2.3.1/lib/initializer.rb:304:in each' from /var/lib/gems/1.8/gems/rails-2.3.1/lib/initializer.rb:304:inload_gems' from /var/lib/gems/1.8/gems/rails-2.3.1/lib/initializer.rb:162:in process' from /var/lib/gems/1.8/gems/rails-2.3.1/lib/initializer.rb:113:insend' from /var/lib/gems/1.8/gems/rails-2.3.1/lib/initializer.rb:113:in run' from /home/jh/git/rba_staff_site/config/environment.rb:13 from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:ingem_original_require' from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in require' from /var/lib/gems/1.8/gems/activesupport-2.3.1/lib/active_support/dependencies.rb:156:inrequire' from /var/lib/gems/1.8/gems/activesupport-2.3.1/lib/active_support/dependencies.rb:521:in new_constants_in' from /var/lib/gems/1.8/gems/activesupport-2.3.1/lib/active_support/dependencies.rb:156:inrequire' from /var/lib/gems/1.8/gems/rails-2.3.1/lib/commands/server.rb:84 from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require' from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:inrequire' from ./script/server:3

yob commented 15 years ago

With rails 2.3.2 and ROXML 2.5.3, this doesn't seem to be an issue anymore

mfvargo commented 14 years ago

I still see deprecation issues with 2.5.3 and rails 2.3.4

mvargo@mvargo-lt:~/workspace/cms$ script/console Loading development environment (Rails 2.3.4)

require 'onix' TypeError: {:to_h=>:to_hash} is not a symbol from /usr/lib/ruby/gems/1.8/gems/deprecated-2.0.1/lib/deprecated.rb:176:in instance_method' from /usr/lib/ruby/gems/1.8/gems/deprecated-2.0.1/lib/deprecated.rb:176:indeprecate' from /usr/lib/ruby/gems/1.8/gems/roxml-2.5.3/lib/roxml/extensions/array/conversions.rb:26 from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require' from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire' from /home/mvargo/workspace/cms/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in require' from /home/mvargo/workspace/cms/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:innew_constants_in' from /home/mvargo/workspace/cms/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in require' from /usr/lib/ruby/gems/1.8/gems/roxml-2.5.3/lib/roxml/extensions/array.rb:9 from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:ingem_original_require' from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in require' from /home/mvargo/workspace/cms/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:inrequire' from /home/mvargo/workspace/cms/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in new_constants_in' from /home/mvargo/workspace/cms/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:inrequire' from /usr/lib/ruby/gems/1.8/gems/roxml-2.5.3/lib/roxml/extensions.rb:5 from /usr/lib/ruby/gems/1.8/gems/roxml-2.5.3/lib/roxml/extensions.rb:4:in each' ... 5 levels... from /home/mvargo/workspace/cms/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:inrequire' from /usr/lib/ruby/gems/1.8/gems/roxml-2.5.3/lib/roxml.rb:7 from /usr/lib/ruby/gems/1.8/gems/roxml-2.5.3/lib/roxml.rb:6:in each' from /usr/lib/ruby/gems/1.8/gems/roxml-2.5.3/lib/roxml.rb:6 from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:ingem_original_require' from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in require' from /home/mvargo/workspace/cms/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:inrequire' from /home/mvargo/workspace/cms/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in new_constants_in' from /home/mvargo/workspace/cms/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:inrequire' from /usr/lib/ruby/gems/1.8/gems/onix-0.7.7/lib/onix.rb:12 from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:36:in gem_original_require' from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:36:inrequire' from /home/mvargo/workspace/cms/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in require' from /home/mvargo/workspace/cms/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:innew_constants_in' from /home/mvargo/workspace/cms/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require' from (irb):1>>

Empact commented 14 years ago

I've posted 3.1, which doesn't use the ActiveSupport deprecation api at all. Let me know if the problem remains.

Empact commented 14 years ago

Switch that: reopen if it's still a problem.

mfvargo commented 14 years ago

Hi,

Got the new code and I can load it up successfully from my rails 2.3.4 env.

class Foo include ROXML xml_accessor :foo_name, :from => "FooName" end => [#<ROXML::Definition:0x7f93bd2de648 @blocks=[], @type=:text, @required=nil, @attr_name="foo_name", @array=false, @namespace=nil, @cdata=nil, @frozen=nil, @accessor="foo_name", @name_explicit=true, @default=nil, @name="FooName", @wrapper=nil, @to_xml=nil>] foo = Foo.new => #Foo:0x7f93bd2daea8 foo.foo_name = "Buddy" => "Buddy" foo.to_xml =>

Buddy

Now I just have to figure out how to bolt it up to the ONIX gem.