Forum: Ruby on Rails rio instabilities

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
E1c74637dbb1b765861978e4c4f6388e?d=identicon&s=25 Tom Armitage (Guest)
on 2006-03-27 13:20
(Received via mailing list)
I'm having some serious problems with rio (rio.rubyforge.org) within my
Rails app and I was wondering if you lot could offer any advice.

So: I'm writing an app that generates folders full of content. The rough
process of what happens when you run the "Generate" method on a "Site"
object is:

it copies a template directory to a directory named (site.directory)
for each line in site.pages it copies
(site.directory)/template_page.html to
(site.directory)/(pagename).html
it then does a great big contents.gsub through each file in the
directory,
replacing some meta-template tags with content.

Now, it creates the files fine, and copies them all fine... but often
throws
errors saying "you can't gsub here" and the reason you can't is because
all
the files are empty.

Sometimes, it writes some of the files correctly and the remainder are
empty; quite often, the whole lot are empty. 0kb.

What's going on? Is this because Ruby is sending commands to the shell
faster than the shell can keep up? I've put various sleep commands in,
but
they don't make a blind bit of difference. Sometimes the whole thing
works
perfectly; sometimes it fails spectacularly. By and large, Rio seems to
work
fine when I mock these functions up in a Ruby script file, but it's when
I
work this stuff into the Rails application that it starts falling over.
Any
pointers?

Best,

t.
This topic is locked and can not be replied to.