From: Shashank Agarwal Date: 2008-06-30T01:39:47+09:00 Subject: Re: How to doing a "grep -v" to hide "---" line added by Hash#to_yaml ? I単aki Baz Castillo wrote: > Hi, when I convert a Hash to a YAML object and print it a line "---" is > added > at the beginning: > > --------------------------------------------------------- > cli> require 'yaml' > cli> puts({1=>2,"ABC" => {"a"=>"A","b"=>"B"}}.to_yaml) > --- > ABC: > a: A > b: B > 1: 2 > => nil > --------------------------------------------------------- > > Well, how could I hide that annoyin "---" line? Maybe using "grep" in > some > way? other suggestion? > > Thanks a lot. Try this x = {1=>2,"ABC" => {"a"=>"A","b"=>"B"}}.to_yaml x = x[5...x.length] -- Posted via http://www.ruby-forum.com/.