Problem using Feedtools on my Rails project!

Hi

I’m trying to setup my app to use Feedtools amazing RSS powers, but it
fails miserably on the following line:

logger.debug("Description:#{FeedTools::Feed.open("http://rss.slashdot.org/Slashdot/slashdot").items.first.description}")

The stack trace says:

wrong number of arguments (0 for 1)

/usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/lib/mongrel/debug.rb:121:in
initialize' /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/lib/mongrel/debug.rb:121:in open’
/usr/local/lib/ruby/gems/1.8/gems/feedtools-0.2.25/lib/feed_tools/vendor/htree/parse.rb:64:in
parse_as' /usr/local/lib/ruby/gems/1.8/gems/feedtools-0.2.25/lib/feed_tools/vendor/htree/parse.rb:51:in parse_xml’
/usr/local/lib/ruby/gems/1.8/gems/feedtools-0.2.25/lib/feed_tools/vendor/htree/fstr.rb:11:in
with_frozen_string_hash' /usr/local/lib/ruby/gems/1.8/gems/feedtools-0.2.25/lib/feed_tools/vendor/htree/parse.rb:50:in parse_xml’
/usr/local/lib/ruby/gems/1.8/gems/feedtools-0.2.25/lib/feed_tools/helpers/html_helper.rb:300:in
sanitize_html' /usr/local/lib/ruby/gems/1.8/gems/feedtools-0.2.25/lib/feed_tools/helpers/html_helper.rb:564:in process_text_construct’
/usr/local/lib/ruby/gems/1.8/gems/feedtools-0.2.25/lib/feed_tools/feed_item.rb:328:in
description' #{RAILS_ROOT}/app/controllers/test_controller.rb:4:in index’
/usr/local/bin/mongrel_rails:18

I’ve put the 'require ‘feed_tools’ line in my config/environment.rb

BUT the most amazing thing is that I can run script/console and, lo and
behold:

require ‘feed_tools’
=> false
FeedTools::Feed.open(“Slashdot”).items.first.description

It works flawlessly! What gives?

On Mon, 2006-07-10 at 18:24 +0200, dachstein wrote:

CRAP! Damn you Mike C., I told you adding that was a bad idea. No
cookie for you.

Ok, only Mike will get what I’m talking about, but basically I goofed
big time. Wait a few minutes because now I have to do a 0.3.13.4
release of Mongrel.

Basically, I threw in request logging at the request of Mike C., who
then promptly didn’t need it, but I left it in. Problem is the
mongrel/debug.rb file does a lot of nasty stuff and shouldn’t be
included unless explicitly requested and is temporary. One of the
things it does is track file opens/closes with Kernel.open hacks, and
those seem to be messing with the Feedtools wonderful hacks that allow
an open call with no arguments.

Give me an hour.

Zed A. Shaw

http://mongrel.rubyforge.org/
http://www.railsmachine.com/ – Need Mongrel support?

Basically, I threw in request logging at the request of Mike C., who
then promptly didn’t need it, but I left it in. Problem is the
mongrel/debug.rb file does a lot of nasty stuff and shouldn’t be
included unless explicitly requested and is temporary. One of the
things it does is track file opens/closes with Kernel.open hacks, and
those seem to be messing with the Feedtools wonderful hacks that allow
an open call with no arguments.

FeedTools has an open call with no arguments? Really? News to me.

Cheers,
Bob A.

AIM: sporkmonger
Jabber: [email protected]

FeedTools has an open call with no arguments? Really? News to me.

checks

Ahh, you mean HTree’s wonderful hacks. :stuck_out_tongue:

Cheers,
Bob A.

AIM: sporkmonger
Jabber: [email protected]

dachstein wrote:

Hi

I’m trying to setup my app to use Feedtools amazing RSS powers, but it
fails miserably on the following line:

logger.debug("Description:#{FeedTools::Feed.open("http://rss.slashdot.org/Slashdot/slashdot").items.first.description}")

…What gives?

Maybe the two nested sets of double quotes? Try changing to single
quotes around the URL?

–Al Evans

Maybe the two nested sets of double quotes? Try changing to single
quotes around the URL?

Nah, Zed’s analysis is correct. You’ll note that:

“foo #{“bar”} baz”
=> “foo bar baz”

Cheers,
Bob A.

AIM: sporkmonger
Jabber: [email protected]

Bob A. wrote:

Nah, Zed’s analysis is correct. You’ll note that:

“foo #{“bar”} baz”
=> “foo bar baz”

Thanks for the info! I guess many years of conditioning prevented me
from even trying it:-)

(It still seems insidiously wrong, somehow…)

–Al Evans

Ok, only Mike will get what I’m talking about, but basically I goofed
big time. Wait a few minutes because now I have to do a 0.3.13.4
release of Mongrel.

Any updates on this, Zed? Sorry for nagging again, but I haven’t seen
any 0.3.13.4 release on the Rubyforge page.

Coming soon. I’ve got a pre-release out but it has problems with Ajax
requests so I’m working on it a bit more. Probably by this weekend.

Thank you, Zed. Mongrel rocks! You rock!

On Fri, 2006-07-14 at 10:18 +0200, dachstein wrote:

Ok, only Mike will get what I’m talking about, but basically I goofed
big time. Wait a few minutes because now I have to do a 0.3.13.4
release of Mongrel.

Any updates on this, Zed? Sorry for nagging again, but I haven’t seen
any 0.3.13.4 release on the Rubyforge page.

Coming soon. I’ve got a pre-release out but it has problems with Ajax
requests so I’m working on it a bit more. Probably by this weekend.


Zed A. Shaw

http://mongrel.rubyforge.org/
http://www.railsmachine.com/ – Need Mongrel support?

dachstein wrote:

Coming soon. I’ve got a pre-release out but it has problems with Ajax
requests so I’m working on it a bit more. Probably by this weekend.

Thank you, Zed. Mongrel rocks! You rock!

Since this issue keeps coming up, I applied a tiny patch to the copy of
HTree included with FeedTools that should prevent the problem from
happening. It’s checked into Subversion, but you’re not likely to see a
release of 0.2.27 anytime soon, so I’m not sure how useful that will be.