diff options
-rw-r--r-- | lib/rbot/core/utils/httputil.rb | 2 | ||||
-rw-r--r-- | lib/rbot/ircbot.rb | 2 | ||||
-rw-r--r-- | lib/rbot/load-gettext.rb | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/lib/rbot/core/utils/httputil.rb b/lib/rbot/core/utils/httputil.rb index 4ea83104..fa0addb9 100644 --- a/lib/rbot/core/utils/httputil.rb +++ b/lib/rbot/core/utils/httputil.rb @@ -25,7 +25,7 @@ require 'zlib' module ::Net class HTTPResponse attr_accessor :no_cache - if !instance_methods.include?('raw_body') + unless method_defined? :raw_body alias :raw_body :body end diff --git a/lib/rbot/ircbot.rb b/lib/rbot/ircbot.rb index 9317fd4d..2f146c29 100644 --- a/lib/rbot/ircbot.rb +++ b/lib/rbot/ircbot.rb @@ -23,7 +23,7 @@ $log_thread = nil require 'pp' -unless Kernel.instance_methods.include?("pretty_inspect") +unless Kernel.respond_to? :pretty_inspect def pretty_inspect PP.pp(self, '') end diff --git a/lib/rbot/load-gettext.rb b/lib/rbot/load-gettext.rb index 4c2dc587..2c65f197 100644 --- a/lib/rbot/load-gettext.rb +++ b/lib/rbot/load-gettext.rb @@ -42,7 +42,7 @@ begin # patch for ruby-gettext 1.x to cope with anonymous modules used by rbot. # bound_targets and related methods are not used nor present in 2.x, and # this patch is not needed - if methods.include? 'bound_targets' + if method_defined? :bound_targets alias :orig_bound_targets :bound_targets def bound_targets(*a) # :nodoc: |