]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
Limit Comparable inclusion to Array
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Wed, 12 Jan 2011 20:25:57 +0000 (21:25 +0100)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Wed, 12 Jan 2011 20:25:57 +0000 (21:25 +0100)
Including Comparable at the top level causes infinite recursions in Ruby
1.9.2

lib/rbot/load-gettext.rb

index 5e2ec1860450306b4e8311ec37038449f271b4d9..d45263e1c2d53de2df2333419c88527242a16c21 100644 (file)
@@ -18,7 +18,9 @@ end
   require 'gettext/version'
 
   gettext_version = GetText::VERSION.split('.').map {|n| n.to_i}
-  include Comparable # for Array#>=
+  class ::Array
+    include Comparable # for Array#>=
+  end
   unless gettext_version >= [1, 8, 0]
     raise GetTextVersionError, "Unsupported ruby-gettext version installed: #{gettext_version.join '.'}; supported versions are 1.8.0 and above"
   end