[macruby-changes] [4222] MacRuby/trunk/sample-macruby/Scripts/rss_parser.rb

source_changes at macosforge.org source_changes at macosforge.org
Sat Jun 12 14:51:44 PDT 2010


Revision: 4222
          http://trac.macosforge.org/projects/ruby/changeset/4222
Author:   mattaimonetti at gmail.com
Date:     2010-06-12 14:51:40 -0700 (Sat, 12 Jun 2010)
Log Message:
-----------
updated the doc & code of the rss parser script example

Modified Paths:
--------------
    MacRuby/trunk/sample-macruby/Scripts/rss_parser.rb

Modified: MacRuby/trunk/sample-macruby/Scripts/rss_parser.rb
===================================================================
--- MacRuby/trunk/sample-macruby/Scripts/rss_parser.rb	2010-06-12 05:32:21 UTC (rev 4221)
+++ MacRuby/trunk/sample-macruby/Scripts/rss_parser.rb	2010-06-12 21:51:40 UTC (rev 4222)
@@ -53,7 +53,7 @@
   # Starts the parsing and send each parsed item through its block.
   #
   # Usage:
-  #   feed.block_while_parsing do |item|
+  #   feed.parse do |item|
   #     puts item.link
   #   end
   def parse(&block)
@@ -91,7 +91,7 @@
   def parser(parser, foundCharacters:string)
     if @current_item && @current_item.respond_to?(@current_element)
       el = @current_item.send(@current_element) 
-      el << string
+      el << string if el.respond_to?(:<<)
     end
   end
   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100612/954f895f/attachment.html>


More information about the macruby-changes mailing list