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:
parent
30a65000ad
commit
fda012a334
3 changed files with 2 additions and 29 deletions
|
@ -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)
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
dir = File.expand_path(File.join(File.dirname(__FILE__), 'core_ext'))
|
||||
require File.join(dir, 'hash')
|
|
@ -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
|
Loading…
Reference in a new issue