Hi
I’m having a strange behavior when using RSS::Parser after requiring
the sequel gem. After doing a require ‘sequel’, the number of news
items is always 0. The script below is a small test which reads a rss
feed with 6 items and prints the number of news items parsed. The
first puts is after requiring ‘rss’, and the last puts is after
requiring ‘sequel’.
require ‘rss’
read 6, should be: 6
require ‘rubygems’
read 6, should be: 6
require ‘sequel’
read 0, should be: 6
I’ve run this script with:
sequel 0.2.1.1 and ruby 1.8.5 (2006-08-25) [i486-linux]
sequel 0.3.0.1 and ruby 1.8.6 (2007-06-07 patchlevel 36) [i486-linux]
Anyone seen this before?
Thanks
—[begin] test_case.rb -----------------------------------------
ITEMS = 6
def rss_items
rss = RSS::Parser.parse(IO.readlines(‘feed.xml’).join)
rss.items.size
end
def compare(items)
puts “read #{items}, should be: #{ITEMS}”
end
require ‘rss’
compare(rss_items)
require ‘rubygems’
compare(rss_items)
require ‘sequel’
compare(rss_items)
—[end] test_case.rb -----------------------------------------
—[begin] feed.xml -----------------------------------------
<?xml version="1.0" encoding="ISO-8859-1"?><item/>
<item/>
<item/>
<item/>
<item/>
<item/>
---[end] test_case.rb -----------------------------------------