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("http://rss.slashdot.org/Slashdot/slashdot").items.first.descriptionIt works flawlessly! What gives? -- Posted via http://www.ruby-forum.com/.
On Mon, 2006-07-10 at 18:24 +0200, 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}") > > The stack trace says: > > wrong number of arguments (0 for 1) >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 Clark, 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://www.zedshaw.com/ http://mongrel.rubyforge.org/ http://www.railsmachine.com/ -- Need Mongrel support?
> Basically, I threw in request logging at the request of Mike Clark, 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 Aman -- AIM: sporkmonger Jabber: sporkmonger@jabber.org
> FeedTools has an open call with no arguments? Really? News to me.*checks* Ahh, you mean HTree''s *wonderful* hacks. :-P Cheers, Bob Aman -- AIM: sporkmonger Jabber: sporkmonger@jabber.org
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 -- Posted via http://www.ruby-forum.com/.
> 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 Aman -- AIM: sporkmonger Jabber: sporkmonger@jabber.org
Al Evans
2006-Jul-11 00:07 UTC
[Rails] Re: Re: Problem using Feedtools on my Rails project!
Bob Aman 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 -- Posted via http://www.ruby-forum.com/.
> 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. -- Posted via http://www.ruby-forum.com/.
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://www.zedshaw.com/ http://mongrel.rubyforge.org/ http://www.railsmachine.com/ -- Need Mongrel support?
dachstein
2006-Jul-14 15:30 UTC
[Rails] Re: Re: Problem using Feedtools on my Rails project!
> 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! -- Posted via http://www.ruby-forum.com/.
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. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---