Forums | Admin

Discussion Forums: open-discussion

Start New Thread Start New Thread

 

By: Göran Uddeborg
RE: Ruby 1.9 doesn't have "each" on strings [ reply ]  
2012-04-21 13:37
That was quick! Thanks.

By: Doga Armangil
RE: Ruby 1.9 doesn't have "each" on strings [ reply ]  
2012-04-21 10:28
Hello Göran,
Version 3.1.6 (which I have released today) contains your patch, plus a couple more. podcatcher should now work with ruby 1.9.

Many thanks for the tip.

By: Göran Uddeborg
Ruby 1.9 doesn't have "each" on strings [ reply ]  
2012-04-20 20:14
I'm no Ruby programmer, so I might be using the wrong terminology here. But I upgraded to ruby 1.9.3.0 on my Fedora system (for the beta version of Fedora 17). Then my podcatcher stopped working. After digging around a bit I figured out I I could set RUBYOPT=--debug in the environment and get a bit of information, and that pointed me to a number of uses of a method "each" which doesn't exist in current Ruby (as I understand it).

I have applied the patch below, and now podcatcher seems to work again for the way I use it.

--- podcatcher~ 2009-10-30 08:53:58.000000000 +0100
+++ podcatcher 2012-04-20 19:21:24.000000000 +0200
@@ -1510,7 +1510,7 @@
title = ''
XPath.each(e1,"title/text()") do |node|
title = ''
- node.value.each() do |e3| #remove line breaks
+ node.value.each_line() do |e3| #remove line breaks
title+= e3.chomp+" "
end
title.strip!
@@ -1518,7 +1518,7 @@
pub_date = nil
XPath.each(e1,"pubDate/text()") do |node|
pub_date = ""
- node.value.each() do |e3| #remove line breaks
+ node.value.each_line() do |e3| #remove line breaks
pub_date+= e3.chomp+" "
end
begin
@@ -1621,7 +1621,7 @@
#title
node = XPath.first(doc.dom,"//channel/title/text()")
feed_title = ""
- node.value.each() do |e3| #remove line breaks
+ node.value.each_line() do |e3| #remove line breaks
feed_title += e3.chomp+" "
end
feed_title.strip!