[ANN] YAML Command v0.1.0

2012-12-12 Thread Intransition
Just released YAML Command v0.1.0. It is a command line tool for working with YAML files. As there doesn't seem to be any other "Shell-based API" for YAML, I thought it might be a good idea to devise one. https://github.com/rubyworks/yaml_command Appreciate any feedback. (Note that the very f

Re: Enumerable#zip with File IO

2012-12-12 Thread Robert Klemme
On Wed, Dec 12, 2012 at 7:11 PM, Bartosz Dziewoński wrote: > Jan, Robert, yes, but that's not the point. > > The same happens with a StringIO: > > irb(main):010:0> require 'stringio' > => true > irb(main):014:0> io = StringIO.new "a\nb\nc\nd\ne" > => # > irb(main):015:0> [1].zip(io.each){|a,b| p a

Re: How I can create/extract a variable/hash into the current binding in Ruby?

2012-12-12 Thread Robert Klemme
On Wed, Dec 12, 2012 at 2:44 PM, Ramon de C Valle wrote: > On 12/12/2012 11:29 AM, Robert Klemme wrote: >> On Wed, Dec 12, 2012 at 12:40 PM, Ramon de C Valle >> wrote: >> >>> Thank you for the additional information! Any suggestions of a possible >>> "more Ruby" way of doing this? >> >> Keep the

Re: Enumerable#zip with File IO

2012-12-12 Thread Robert Klemme
On Wed, Dec 12, 2012 at 12:51 PM, 林彰史 wrote: > Yes I agree that it makes no sense, but I wanted to see how zip method works > with File IO with a simple experimental code. > My point is why the second line of input is discarded. That might be an artifact of unhealthy using of the Enumerator becau

Re: How I can create/extract a variable/hash into the current binding in Ruby?

2012-12-12 Thread Robert Klemme
On Wed, Dec 12, 2012 at 12:40 PM, Ramon de C Valle wrote: > Thank you for the additional information! Any suggestions of a possible > "more Ruby" way of doing this? Keep the data in the Hash and use it there. If you think about it you will need eval for manipulation of the data as well because