1
0
Fork 0
mirror of https://github.com/jnunemaker/httparty synced 2023-03-27 23:23:07 -04:00

Removed stupid core extension. It was stupid trust me.

This commit is contained in:
John Nunemaker 2008-11-08 10:41:32 -05:00
parent 30a65000ad
commit fda012a334
3 changed files with 2 additions and 29 deletions

View file

@ -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)

View file

@ -1,2 +0,0 @@
dir = File.expand_path(File.join(File.dirname(__FILE__), 'core_ext'))
require File.join(dir, 'hash')

View file

@ -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