On Wed, 22 Oct 2008, Seth Thomas Rasmussen wrote:
> On Wed, Oct 22, 2008 at 1:44 PM, Hugh Sasse <[EMAIL PROTECTED]> wrote:
> > YAML::load takes a string.
> >
> > I think you need this
> > filename = File.join("#{ENV['HOME'] || ENV['USERPROFILE']}",'.gutter.yml')
> > data = ''
> > open(filename){|fp| data = fp.read} # the block closes the file
> > conf = YAML::load(data)
>
> Pff!
>
> People often go through all those motions when all they really need is
> to say: YAML.load_file(path_to_file)
:-) Good point. I was trying to emphasise keeping the lines short.
This helps when Ruby coughs up a line number, because it is easier
to see which bit went POP!
I also wanted to get this misuse of open (2nd one today!) squished.
>
> Spread the love, plz.
>
Hugh