From: Hassan Schroeder Date: 2013-06-17T23:22:46+09:00 Subject: Re: Issue in reading data from yaml file On Mon, Jun 17, 2013 at 4:04 AM, Robert Klemme wrote: >> If you (ahem) read the docs, YAML.load works on strings, not files, > > Does it? Via the http://ruby-doc.org/stdlib-1.9.3/libdoc/yaml/rdoc/YAML.html "Usage" example: require 'yaml' # STEP ONE, REQUIRE YAML! # Parse a YAML string YAML.load("--- foo") #=> "foo" Seems straightforward enough :-) > I'd rather use the form with the IO object because that avoids the overhead > of reading the whole file into memory at once. The phrase "premature optimization" comes to mind, given the example under discussion, but whatever floats your boat :-) -- Hassan Schroeder ------------------------ hassan.schroeder@gmail.com http://about.me/hassanschroeder twitter: @hassan