Since in 1.9 methods arrays have symbols instead of strings, fix it by
changing into respond_to? and method_defined?
module ::Net
class HTTPResponse
attr_accessor :no_cache
- if !instance_methods.include?('raw_body')
+ unless method_defined? :raw_body
alias :raw_body :body
end
require 'pp'
-unless Kernel.instance_methods.include?("pretty_inspect")
+unless Kernel.respond_to? :pretty_inspect
def pretty_inspect
PP.pp(self, '')
end
# 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: