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”
it copies a template directory to a directory named (site.directory)
for each line in site.pages it copies
it then does a great big contents.gsub through each file in the
replacing some meta-template tags with content.
Now, it creates the files fine, and copies them all fine… but often
errors saying “you can’t gsub here” and the reason you can’t is because
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,
they don’t make a blind bit of difference. Sometimes the whole thing
perfectly; sometimes it fails spectacularly. By and large, Rio seems to
fine when I mock these functions up in a Ruby script file, but it’s when
work this stuff into the Rails application that it starts falling over.