From 4eb14a17ba94856053b7e11ae6488b1a331c7e91 Mon Sep 17 00:00:00 2001 From: John Nunemaker Date: Sat, 22 Aug 2009 10:30:53 -0400 Subject: [PATCH] Switched from BlankSlate to BasicObject and only defining it if it doesn't exist for ruby 1.9 compat. Closes gh-20 --- lib/httparty/core_extensions.rb | 10 +++------- lib/httparty/response.rb | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/httparty/core_extensions.rb b/lib/httparty/core_extensions.rb index 948411d..fcf33ea 100644 --- a/lib/httparty/core_extensions.rb +++ b/lib/httparty/core_extensions.rb @@ -1,10 +1,6 @@ -if RUBY_VERSION.to_f == 1.8 - class BlankSlate #:nodoc: - instance_methods.each { |m| undef_method m unless m =~ /^__|instance_eval|object_id/ } - end -else - class BlankSlate < BasicObject; end -end +class BasicObject #:nodoc: + instance_methods.each { |m| undef_method m unless m =~ /^__|instance_eval/ } +end unless defined?(BasicObject) # 1.8.6 has mistyping of transitive in if statement require "rexml/document" diff --git a/lib/httparty/response.rb b/lib/httparty/response.rb index 2670b51..83529db 100644 --- a/lib/httparty/response.rb +++ b/lib/httparty/response.rb @@ -1,5 +1,5 @@ module HTTParty - class Response < BlankSlate #:nodoc: + class Response < BasicObject #:nodoc: attr_accessor :body, :code, :message, :headers attr_reader :delegate