Here's the problem, under Windows: irb(main):001:0> f = File.open('x',binmode:true) ArgumentError: both textmode and binmode specified from (irb):1:in `initialize' from (irb):1:in `open' from (irb):1 ...yimutang (Joey Zhou)
I was inspired by Ruby 1.9.x`s Enumerable#chunk and #slice_before, which both take a block and return an enumerator. I wish to introduce two new method into the Enumerable core, which can be implemented in Ruby like this: module E...yimutang (Joey Zhou)
My Ruby version is: ruby 1.9.3p125 (2012-02-16) [i386-mingw32] I found that the 'rescue' modifier can not be used in 'require', for example: require 'not_exist' rescue require 'set' # this will raise a LoadError I must write a...yimutang (Joey Zhou)
Yui NARUSE wrote: > Why don't you use $~, $&, $`, $', $+, $1, $2, .. in scan' block parameter? You reminds me! Yes, what I want can be done in this tricky way. Thank you! However, I think relying on these special global variables ...yimutang (Joey Zhou)
The String class should contain an instance method 'match_all', which is a mixture of 'match' and 'scan'. The method 'scan' is not a very powerful tool, its result(the yielding thing) is just a matched string or an array of captured s...yimutang (Joey Zhou)
Magnus Holm wrote: > Nobody knows them. Nobody uses them. Let's just get rid of flip-flops, shall we? Well, the flip-flop behavior is useful, so it should not be removed. However, I agree that the syntax is a bit confusing. Fli...yimutang (Joey Zhou)