[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sup-talk] [PATCH] Remove use of Object tap method



Excerpts from Ben Walton's message of Tue Mar 02 11:20:51 -0800 2010:
> Remove ruby 1.9-ism in buffer.rb.  This keeps things running on older
> ruby versions.

What about adding a lib/sup/tap.rb that looks like this:

    unless Object.respond_to?(:tap)
      class Object
        def tap
          yield self
          self
        end
      end
    end

and then adding a:

    require 'tap'

to lib/sup.rb?  'tap' is a really handy little method that cleans up
code nicely. :)
-- 
Rick Tessner
rick.tessner@gmail.com
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk