Forum: Ruby Ruby Weekly News 6th - 12th February 2006

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
unknown (Guest)
on 2006-02-15 11:49
(Received via mailing list)

Ruby Weekly News 6th - 12th February 2006

   Ruby Weekly News is a summary of the week's activity on the ruby-talk
   mailing list / the comp.lang.ruby newsgroup / Ruby forum, brought to
   by Tim S..

   [ Contribute to the next newsletter ]

User Group News

     * OK.rb's First Meeting

       James Edward G. II announced the first meeting of the Oklahoma
       Users Group: March 14th 2006 at the University of Central

       | This first meeting is being organized by myself and Grant
       | and we will be providing some educational content to get us
going. I
       | will give a "Uniquely Ruby" talk, focusing on those things that
       | Ruby stand out from other languages. Grant is giving a
first-look at
       | Rails presentation as well. Both talks will be aimed at Ruby
       | programmers of all skill levels.

     * Boulder-Denver Ruby Group - February 15th

       Marty H. said that the Boulder-Denver Ruby Group are holding
       February meeting on Wednesday 15th.

       "David A. Black will be joining our group that night and will be
       presenting for our group."

     * February Ruby events in the SF Bay Area

       Rich M. posted a list of Ruby events in the San Francisco Bay
       during February.

       The SF Ruby Meetup is on the 21st, and the Beer & Scripting SIG
is on
       the 22nd.

Quote of the Week

     * Ruby's lisp features.

> Let's call it MatzLisp from now on. ;-)
>                                                         matz.


  FasterGenerator (#66)

   James Edward G. II came up with this week's Ruby Q..

>         end
Ruby's standard Generator class was recently re-written to improve
   performance. Your mission is to make it even faster.

   Matz: "I'd be happy to replace current implementation of generator.rb
   the winning one."

   Some very promising benchmarks were posted.

  Getting last character from a string

   draco draco asked for a nice way of getting the last character in a

   Several people said that you can use negative indices to count
   from the end of String and Array objects, for example -1 for the end,
   for the second-to-last etc.

   Based off a post by Gennady B.,

 s = "abc"
 s[-1] # 99
 s[-1].chr # "c"

  Adding properties to a method?

   jonT wanted to know how to add `properties' to Method objects.

 class Method
   attr_accessor :foo

 def bar

 method(:bar).foo = 1

 puts(method(:bar).foo) # => nil instead of 1

   The problem is that method(:bar) returns a new Method instance each
   it is called.

   As is often the case, the Facets project has a solution. It includes
   method!, which returns the same Method instance each time it's given
   same method name.

   (Not so good if some code redefines the method in between two calls
   method! though.)

  Ruby port for Nokia 770 Wireless Internet Tablet

   Ken Hilton successfully ported Ruby 1.8.4 to the "Nokia 770 Wireless
   Internet Tablet" (which runs Linux).

   "Before porting Ruby to it, it was love at first sight. Now I'm

   He will be posting a tarball once he's setup a rubyforge account.

  how to do instance_eval with arguments

   Jim W.: "I'm prototyping a DSL and came across a situtation
where I
   have a lambda that I would like to give to instance_eval, but the
   takes arguments. Instance_eval will not supply any arguments when
   evaluating the lambda and I don't see a straightforward way around

   Matz said that Ruby in CVS HEAD has instance_exec for this.

   See also [Frost-safe DSL'ing with instance_exec] by Mauricio
   which gives a safe implementation of instance_exec for Ruby 1.8.

   The above article was found via Christian N.'s [Anarchaia].
   Chris also questioned why a new method was added, rather than just
   instance_eval pass any arguments it receives.

   For those readers who are confused about why you would ever need this
   feature (as was I initially), note that it is never needed in the
   case when the block passed in is defined on the spot.

 # Not useful
 value = 42
 obj.instance_exec(value) { |v| some_method(v) }

 # Lexical scoping means we could just write
 value = 42
 obj.instance_eval { some_method(value) }

   Consider the case, though, where a block taking arguments has been
   somewhere else, and we now want to instance_eval it.

 # This doesn't achieve anything. blk isn't evaluated against obj.
 value = 42
 obj.instance_eval { }

 # This works
 value = 42
 obj.instance_exec(value, &blk)

New Releases

A few of the highlights this week ...

  Watir WebRecorder for Ruby

   Marcus Tettmar announced Watir WebRecorder, "a version of WebRecorder
   creates Ruby/Watir code. Watir WebRecorder is a multi-tabbed web
   that records web activity in Internet Explorer and creates Ruby code
   uses the Watir library for IE automation.

   WebRecorder is designed to speed up the creation of web testing and
   automation scripts."

  Nitro + Og 0.28.0: Cacheable, Ruby Query Language, Mongrel, Og cloning

   George M. released new versions of Nitro and Og, a web
   application framework and object-relational mapper respectively.

   Caching and querying were improved, bugs fixed, plus a bunch of other


   Hannes W. announced a pure-Ruby library for reading Excel files. It
   based off the Perl module of the same name.
This topic is locked and can not be replied to.