Permalink
Browse files

RubyGems obsoleted *and* b0rked all_load_path, try to work around it

  • Loading branch information...
1 parent af91a80 commit 7a6221adf24e81ef1e47441bd848241adfa02ba6 @Oblomov Oblomov committed Mar 4, 2012
Showing with 23 additions and 1 deletion.
  1. +23 −1 lib/rbot/load-gettext.rb
View
24 lib/rbot/load-gettext.rb
@@ -43,7 +43,29 @@ class ::Array
else
warning 'This version of ruby-gettext does not support non-cached mode; mo files are not reloaded when setting language'
end
- bindtextdomain 'rbot'
+
+ begin
+ bindtextdomain 'rbot'
+ rescue NoMethodError => e
+ error e
+ warning 'Trying to work around RubyGems/GetText incompatibility'
+ module ::Gem
+ def self.all_load_paths
+ result = []
+
+ Gem.path.each do |gemdir|
+ each_load_path all_partials(gemdir) do |load_path|
+ result << load_path
+ end
+ end
+
+ result
+ end
+ end
+ retry
+ end
+
+
module GetText
# patch for ruby-gettext 1.x to cope with anonymous modules used by rbot.

0 comments on commit 7a6221a

Please sign in to comment.