Ticket #90 (closed enhancement: fixed)

Opened 1 year ago

Last modified 1 year ago

[help wanted] replace XmlSimple with hpricot

Reported by: jon.egil.stra..@gmail.com Assigned to:
Priority: major Milestone: 0.4
Component: Merb Keywords:
Cc:

Description

Want to contribute to merb? Great, here's something we need:

#58 highlights that merb has a secret dependency on XmlSimple?. For perfomance and to fix the dependency, it should be replaced by hpricot.

Can you do that? Then please help out by looking into it and implement a patch. Normal coding standards apply. Honor and praise is up for grabs.

Attachments

merb_core_ext_spec.rb.diff (4.7 kB) - added by has.s..@gmail.com on 07/18/07 05:37:30.
Some specs to start off discussion of expected behaviour
merb_hash_from_xml_hpricot.diff (12.4 kB) - added by has.s..@gmail.com on 07/18/07 09:36:30.
merb.rb.diff (255 bytes) - added by devja..@dusty.name on 07/18/07 15:49:00.
Added require hpricot to merb.rb

Change History

07/18/07 05:37:30 changed by has.s..@gmail.com

  • attachment merb_core_ext_spec.rb.diff added.

Some specs to start off discussion of expected behaviour

07/18/07 09:23:17 changed by has.s..@gmail.com

This patch is to conform to the specs provided in the first spec patch file.

A Simple benchmark of previous vs new over 1000 iterations produced:

user system total real

Old Method 8.160000 0.070000 8.230000 ( 8.319891) New Method 4.090000 0.060000 4.150000 ( 4.179406)

07/18/07 09:36:30 changed by has.s..@gmail.com

  • attachment merb_hash_from_xml_hpricot.diff added.

07/18/07 12:10:06 changed by e.@brainspl.at

  • status changed from new to closed.
  • resolution set to fixed.

(In [326]) replace Hash#from_xml with a nice hpricot version so we don't need the janky xml-simple dependency, closes #90 thanks has.s..@gmail.com, nice first patch

07/18/07 15:45:33 changed by devja..@dusty.name

  • status changed from closed to reopened.
  • resolution deleted.

I was getting the following error trying out merb from trunk today:

irb(main):002:0> require 'merb' NameError?: uninitialized constant Hpricot

from /opt/local/lib/ruby/gems/1.8/gems/merb-0.3.7/lib/merb/core_ext/merb_hash.rb:148

This seemed to do the trick:

Index: merb.rb =================================================================== --- merb.rb (revision 327) +++ merb.rb (working copy..@@ -12,6 +12,7 @@

require 'erubis' require 'logger' require 'json'

+require 'hpricot'

module Merb

I re-opened the ticket. Please let me know if I shouldn't have done that.

Thanks!

07/18/07 15:49:00 changed by devja..@dusty.name

  • attachment merb.rb.diff added.

Added require hpricot to merb.rb

07/18/07 23:54:59 changed by jon.egil.stra..@gmail.com

Ofcourse you may reopen the ticket, this seems like a valid bug and a valid fix. Unfortunately I'm not on my dev box right now, so if someone can verify this, we'll be good to go. Thank you.

07/24/07 05:49:55 changed by jon.egil.stra..@gmail.com

  • reporter changed from j..@luretanker.no to jon.egil.stra..@gmail.com.

I can't verify this. It seems you are trying to run merb through irb, but the way to interact with your application is through "merb -i" from application root.

07/27/07 09:22:34 changed by has.s..@gmail.com

  • status changed from reopened to closed.
  • resolution set to fixed.

Fixed in [340]