From: Dave Thomas Date: 2003-12-17T05:45:51+09:00 Subject: Re: Newbie questions --Apple-Mail-57-958555219 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed On Dec 16, 2003, at 13:28, Carter Thompson wrote: > Absolutely! I'm currently very fluent with Perl and I'm struggling > with Ruby. Lack of adequate documentation is making my learning > experience more time consuming and somewhat more frustrating. More > Ruby documentation would significantly improve my Ruby experience. > I'm working on one component of this as we speak. I just committed the first Ruby interpreter source file with embedded documentation. Once this task is finished, you'll be able to generate RDoc documentation of all of Ruby (and any libraries that choose to participate). You'll also have full 'ri' integration. For example, I can now say: dave[ruby/lib 14:42:34] ri Array.zip -------------------------------------------------------------- Array#zip array.zip(arg, ...) -> an_array array.zip(arg, ...) {| arr | block } -> nil ------------------------------------------------------------------------ Converts any arguments to arrays, then merges elements of _self_ with corresponding elements from each argument. This generates a sequence of self#size _n_-element arrays, where _n_ is one more that the count of arguments. If the size of any arguemnt is less than enumObj#size, nil values are supplied. If a block given, it is invoked for each output array, otherwise an array of arrays is returned. a = [ 4, 5, 6 ] b = [ 7, 8, 9 ] [1,2,3].zip(a, b) #=> [[1, 4, 7], [2, 5, 8], [3, 6, 9]] [1,2].zip(a,b) #=> [[1, 4, 7], [2, 5, 8]] a.zip([1,2],[8]) #=> [[4,1,8], [5,2,nil], [6,nil,nil]] dave[ruby/lib 14:42:40] ri Date.step -------------------------------------------------------------- Date#step step(limit, step) {|date| ...} ------------------------------------------------------------------------ Step the current date forward +step+ days at a time (or backward, if +step+ is negative) until we reach +limit+ (inclusive), yielding the resultant date at each step. (forgive the funky markup symbols: it's a work in progress...) Cheers Dave --Apple-Mail-57-958555219 Content-Transfer-Encoding: 7bit Content-Type: text/enriched; charset=US-ASCII On Dec 16, 2003, at 13:28, Carter Thompson wrote: Absolutely! I'm currently very fluent with Perl and I'm struggling with Ruby. Lack of adequate documentation is making my learning experience more time consuming and somewhat more frustrating. More Ruby documentation would significantly improve my Ruby experience. I'm working on one component of this as we speak. I just committed the first Ruby interpreter source file with embedded documentation. Once this task is finished, you'll be able to generate RDoc documentation of all of Ruby (and any libraries that choose to participate). You'll also have full 'ri' integration. For example, I can now say: Courier Newdave[ruby/lib 14:42:34] ri Array.zip -------------------------------------------------------------- Array#zip array.zip(arg, ...) -> an_array array.zip(arg, ...) {| arr | block } -> nil ------------------------------------------------------------------------ Converts any arguments to arrays, then merges elements of _self_ with corresponding elements from each argument. This generates a sequence of <self#size< _n_-element arrays, where _n_ is one more that the count of arguments. If the size of any arguemnt is less than <enumObj#size<, <nil< values are supplied. If a block given, it is invoked for each output array, otherwise an array of arrays is returned. a = [ 4, 5, 6 ] b = [ 7, 8, 9 ] [1,2,3].zip(a, b) #=> [[1, 4, 7], [2, 5, 8], [3, 6, 9]] [1,2].zip(a,b) #=> [[1, 4, 7], [2, 5, 8]] a.zip([1,2],[8]) #=> [[4,1,8], [5,2,nil], [6,nil,nil]] dave[ruby/lib 14:42:40] ri Date.step -------------------------------------------------------------- Date#step step(limit, step) {|date| ...} ------------------------------------------------------------------------ Step the current date forward +step+ days at a time (or backward, if +step+ is negative) until we reach +limit+ (inclusive), yielding the resultant date at each step. (forgive the funky markup symbols: it's a work in progress...) Cheers Dave --Apple-Mail-57-958555219--