Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Monkey patch benchmark Ruby 1.9 support

  • Loading branch information...
commit 8bab1e54c97ee250790c034fd889ee48cc180536 1 parent 9c9620b
@ai authored
Showing with 7 additions and 1 deletion.
  1. +7 −1 benchmark/benchmark.rb
View
8 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
Please sign in to comment.
Something went wrong with that request. Please try again.