diff --git a/lib/httparty.rb b/lib/httparty.rb index dea5687..6104b91 100644 --- a/lib/httparty.rb +++ b/lib/httparty.rb @@ -5,15 +5,11 @@ require 'ostruct' require 'rubygems' require 'active_support' -$:.unshift(File.dirname(__FILE__)) unless - $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__))) - -dir = File.expand_path(File.join(File.dirname(__FILE__), 'httparty')) -require dir + '/core_ext' +directory = File.dirname(__FILE__) +$:.unshift(directory) unless $:.include?(directory) || $:.include?(File.expand_path(directory)) module HTTParty class UnsupportedFormat < StandardError; end - class RedirectionTooDeep < StandardError; end def self.included(base) diff --git a/lib/httparty/core_ext.rb b/lib/httparty/core_ext.rb deleted file mode 100644 index f03369b..0000000 --- a/lib/httparty/core_ext.rb +++ /dev/null @@ -1,2 +0,0 @@ -dir = File.expand_path(File.join(File.dirname(__FILE__), 'core_ext')) -require File.join(dir, 'hash') \ No newline at end of file diff --git a/lib/httparty/core_ext/hash.rb b/lib/httparty/core_ext/hash.rb deleted file mode 100644 index eb9c696..0000000 --- a/lib/httparty/core_ext/hash.rb +++ /dev/null @@ -1,21 +0,0 @@ -module HTTParty - module CoreExt - module HashConversions - def to_struct - o = OpenStruct.new - self.each do |k, v| - # if id, we create an accessor so we don't get warning about id deprecation - if k.to_s == 'id' - o.class.class_eval "attr_accessor :id" - o.id = v - else - o.send("#{k}=", v.is_a?(Hash) ? v.to_struct : v) - end - end - o - end - end - end -end - -Hash.send :include, HTTParty::CoreExt::HashConversions \ No newline at end of file