when calling scrub on an empty (nil) hpricot object, hpricot_scrub fails.
here is the error message:
/usr/lib/ruby/gems/1.8/gems/hpricot_scrub-0.3.7/lib/hpricot_scrub/hpricot_scrub.rb:256:in scrub': undefined methodreverse' for nil:NilClass (NoMethodError)
from /usr/lib/ruby/gems/1.8/gems/hpricot_scrub-0.3.7/lib/hpricot_scrub/hpricot_scrub.rb:268:in `scrub!'
from /usr/lib/ruby/gems/1.8/gems/hpricot_scrub-0.3.7/lib/hpricot_scrub/hpricot_scrub.rb:272:in `scrub'
here is a fix: (line 256 of hpricot_scrub-0.3.7/lib/hpricot_scrub/hpricot_scrub.rb)
def scrub(config=nil)
config = Scrub::normalize_config(config)
if children
children.reverse.each do |child|
child.scrub(config) if child.scrubbable?
end
end
return self
end
regards,
parasew