From 25864655228060b1659c696fc40d0808ab5229f0 Mon Sep 17 00:00:00 2001 From: Charles Lowell Date: Wed, 17 Feb 2010 07:02:16 -0600 Subject: [PATCH] add tap support to 1.8.6 --- lib/v8.rb | 1 + lib/v8/tap.rb | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 lib/v8/tap.rb diff --git a/lib/v8.rb b/lib/v8.rb index 78ab661..68d3567 100644 --- a/lib/v8.rb +++ b/lib/v8.rb @@ -7,4 +7,5 @@ module V8 require 'v8/to' require 'v8/context' require 'v8/object' + require 'v8/tap' end \ No newline at end of file diff --git a/lib/v8/tap.rb b/lib/v8/tap.rb new file mode 100644 index 0000000..ebb26e1 --- /dev/null +++ b/lib/v8/tap.rb @@ -0,0 +1,8 @@ + +unless Object.method_defined?(:tap) + class Object + def tap + yield self + end + end +end