If you came here due to the reddit link, I have moved over to here. The article on Ruby and Haskell appears there, with updates based on some feedback on reddit. I will not be posting to this site in the future.

Advertisements

NOTE: I have moved the blog to http://rubynations.blogspot.com. This post appears there in a more final form, with some updates based on feedback on reddit. To avoid further confusion, I have removed the text from the post here.

Blog reboot

22Dec06

After a couple of false starts at this blogging thing, I’m determined to make a go of it. If nobody but me ever reads this, at least it will be a place for me to put things that I need to remember…

Coming next…an article on my excursion into Haskell and its effect on my Ruby programming.


I’ve found (and stolen from others) a number of tricks over time to make life in IRB and the Rails console (which is just IRB…) a bit easier. Here are a few to start.

Saving an object to YAML

Periodically, I need to save an object in YAML form. This does the trick –

`echo "#{User.find(1).to_yaml}" > user.yml`

Explanation: The only real trick here is using the fact that enclosing the statement in backticks (`) tells IRB to treat this as a shell command.