Comment 5 for bug 675061

Revision history for this message
Brad Folkens (bfolkens) wrote : Re: [Bug 675061] Re: undefined method `match' for {}:Hash in itunes_duration=

I was using the podcast module.

On Nov 16, 2010, at 8:03 PM, mathew <email address hidden> wrote:

>> http://www.npr.org/rss/podcast.php?id=510284
>
> Hmm. I'm not getting an error running the code below with syndication
> 0.6.2:
>
> require 'syndication/rss'
> require 'open-uri'
>
> url = 'http://www.npr.org/rss/podcast.php?id=510284'
>
> parser = Syndication::RSS::Parser.new
>
> xml = nil
>
> open(url) { |http|
> xml = http.read
> }
>
> feed = parser.parse(xml)
>
> for i in feed.items
> puts i.enclosure.url
> puts i.enclosure.type
> puts i.enclosure.length
> puts
> end
>
>
> mathew
> --
> <URL:http://www.pobox.com/~meta/>
>
> --
> undefined method `match' for {}:Hash in itunes_duration=
> https://bugs.launchpad.net/bugs/675061
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in Web Syndication for Ruby: New
>
> Bug description:
> Getting the following while trying to parse a podcast:
>
> undefined method `match' for {}:Hash
> /Users/bfolkens/.gems/gems/syndication-0.6.2/lib/syndication/podcast.rb:34:in `itunes_duration='
> /Users/bfolkens/.gems/gems/syndication-0.6.2/lib/syndication/common.rb:52:in `send'
> /Users/bfolkens/.gems/gems/syndication-0.6.2/lib/syndication/common.rb:52:in `tag_start'
> /Users/bfolkens/.gems/gems/syndication-0.6.2/lib/syndication/common.rb:236:in `tag_start'
> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rexml/parsers/streamparser.rb:24:in `parse'
> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rexml/document.rb:201:in `parse_stream'
> /Users/bfolkens/.gems/gems/syndication-0.6.2/lib/syndication/common.rb:188:in `parse'
>
> Attached a patch, works and passes all tests, but I'm not sure if this is an "appropriate" fix.
>
> To unsubscribe from this bug, go to:
> https://bugs.launchpad.net/ruby-syndication/+bug/675061/+subscribe