I recently upgraded to 0.5.10 from 0.5.7, and it appears that the feed sorting bug has not been fixed, that I recall mentioning in the past, and explaining how to fix. That is, in the sort on line 64 in feed.rb, a and b should be reversed as either parameters or in the test. Without this fix, Webgen includes the oldest posts in the feed. Also I''m getting the following error now: Error while creating a node from </faq/entries/index.virtual> with Webgen::SourceHandler::Virtual: can''t convert Webgen::Node into String /usr/lib/ruby/gems/1.8/gems/webgen-0.5.10/lib/webgen/sourcehandler/virtual.rb:74:in `join'' /usr/lib/ruby/gems/1.8/gems/webgen-0.5.10/lib/webgen/sourcehandler/virtual.rb:74:in `create_directories'' ... This file contains \--- !omap - index.html: url: /faq/entries.html -- Stop Gnomes and other pests! Purchase Windows today! http://iki.fi/tuomov/b/archives/2009/07/21/T17_26_09/
> I recently upgraded to 0.5.10 from 0.5.7, and it appears that > the feed sorting bug has not been fixed, that I recall mentioning > in the past, and explaining how to fix. That is, in the sort on > line 64 in feed.rb, a and b should be reversed as either parameters > or in the test. Without this fix, Webgen includes the oldest posts > in the feed.I have fixed this now, thanks!> Also I''m getting the following error now: > > Error while creating a node from </faq/entries/index.virtual> with > Webgen::SourceHandler::Virtual: > can''t convert Webgen::Node into String > /usr/lib/ruby/gems/1.8/gems/webgen-0.5.10/lib/webgen/sourcehandler/virtual.rb:74:in > `join'' /usr/lib/ruby/gems/1.8/gems/webgen-0.5.10/lib/webgen/sourcehandler/virtual.rb:74:in > `create_directories'' ...Does this error still occur after you have deleted the cache file and run webgen again? -- Thomas
On 2009-08-24, Thomas Leitner <t_leitner at gmx.at> wrote:> I have fixed this now, thanks!Good.>> Error while creating a node from </faq/entries/index.virtual> with >> Webgen::SourceHandler::Virtual: >> can''t convert Webgen::Node into String >> /usr/lib/ruby/gems/1.8/gems/webgen-0.5.10/lib/webgen/sourcehandler/virtual.rb:74:in >> `join'' /usr/lib/ruby/gems/1.8/gems/webgen-0.5.10/lib/webgen/sourcehandler/virtual.rb:74:in >> `create_directories'' ... > > Does this error still occur after you have deleted the cache file and > run webgen again?Yes. -- "[Fashion] is usually a form of ugliness so intolerable that we have to alter it every six months." -- Oscar Wilde
On 2009-08-24, Tuomo Valkonen <tuomov at iki.fi> wrote:>>> Error while creating a node from </faq/entries/index.virtual> with >>> Webgen::SourceHandler::Virtual: >>> can''t convert Webgen::Node into String >>> /usr/lib/ruby/gems/1.8/gems/webgen-0.5.10/lib/webgen/sourcehandler/virtual.rb:74:in >>> `join'' /usr/lib/ruby/gems/1.8/gems/webgen-0.5.10/lib/webgen/sourcehandler/virtual.rb:74:in >>> `create_directories'' ... >> >> Does this error still occur after you have deleted the cache file and >> run webgen again? > > Yes.Adding a ''return'' statement in the iterated function or whatever (I don''t know the ruby terminology or ruby much) seems to fix this. It seems that returning parent (Node) from the iterated function confuses iterator. def create_directories(dirname, path) parent = website.tree.root dirname.sub(/^\//, '''').split(''/'').inject(''/'') do |parent_path, dir| pp = File.join(parent_path, dir) parent = create_directory(pp, path) return # <---- THIS end parent end -- Be an early adopter! Beat the herd! Choose Windows today!
Am Mon, 31 Aug 2009 16:38:43 +0000 (UTC) schrieb Tuomo Valkonen <tuomov at iki.fi>:> On 2009-08-24, Tuomo Valkonen <tuomov at iki.fi> wrote: > >>> Error while creating a node from </faq/entries/index.virtual> with > >>> Webgen::SourceHandler::Virtual: > >>> can''t convert Webgen::Node into String > >>> /usr/lib/ruby/gems/1.8/gems/webgen-0.5.10/lib/webgen/sourcehandler/virtual.rb:74:in > >>> `join'' /usr/lib/ruby/gems/1.8/gems/webgen-0.5.10/lib/webgen/sourcehandler/virtual.rb:74:in > >>> `create_directories'' ... > >> > >> Does this error still occur after you have deleted the cache file > >> and run webgen again? > > > > Yes. > > Adding a ''return'' statement in the iterated function or whatever > (I don''t know the ruby terminology or ruby much) seems to fix this. > It seems that returning parent (Node) from the iterated function > confuses iterator. > > def create_directories(dirname, path) > parent = website.tree.root > dirname.sub(/^\//, '''').split(''/'').inject(''/'') do |parent_path, > dir| pp = File.join(parent_path, dir) > parent = create_directory(pp, path) > return # <---- THIS > end > parent > endThat does only seem to fix the error as return will return from the entiry method and not only from one iterator run. I have fixed this now, you just have to change `return` to `parent_path`. Best regards, Thomas