Aptinstaller 0.3.2 Released

January 14th, 2009 by

Do you program ruby on rails? Do you use geminstaller? Do you run Ubuntu?

If you want to pull it all together, read on!

Read the rest of this entry »

Ruby: Patch to fix broken YAML.dump for multi-line strings (String#to_yaml)

September 4th, 2008 by

I love YAML. It’s portable. The majority of languages I work with already have libraries built to read/write it. It’s more lightweight, more expressive, and easier to read than XML. I really love YAML.

Unfortunately, it turns out that Ruby’s YAML library is a little incomplete for some edge cases. I just discovered that YAML.dump fails to generate valid YAML for certain multi-line strings. The specifics are very difficult to explain, and we’ll summarize them at the end after trying out some examples. Fire up irb and give the following a try.

require 'yaml'
s = "\n  Something embedded.\nAnd on a new line."
YAML.load(YAML.dump(s))

Read the rest of this entry »

  • You are currently browsing the archives for the YAML category.