From 8bab1e54c97ee250790c034fd889ee48cc180536 Mon Sep 17 00:00:00 2001 From: "Andrey A.I. Sitnik" Date: Thu, 5 Jul 2012 02:03:20 +0400 Subject: [PATCH] Monkey patch benchmark Ruby 1.9 support --- benchmark/benchmark.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/benchmark/benchmark.rb b/benchmark/benchmark.rb index d52d3161..a9bcf612 100755 --- a/benchmark/benchmark.rb +++ b/benchmark/benchmark.rb @@ -23,6 +23,12 @@ I18n::Backend::Simple.send(:include, I18n::Backend::InterpolationCompiler) I18n::Backend::Simple.send(:include, I18n::Backend::Flatten) +class Array + def nitems + count {|i| !i.nil?} + end +end + RBench.run(1000) do column :r18n, :title => 'R18n' @@ -82,7 +88,7 @@ r18n { R18n.get.user.count(51) } - i18n { + i18n { I18n.t :'user.count', :count => 51 } end