Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Now using crack for xml and json parsing instead of bundling that in …
…HTTParty. Hopefully panic will not ensue.
  • Loading branch information
jnunemaker committed Mar 29, 2009
1 parent 8115056 commit 690eeb8
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 953 deletions.
1 change: 1 addition & 0 deletions Rakefile
Expand Up @@ -14,6 +14,7 @@ Echoe.new(ProjectName, HTTParty::Version) do |p|
p.url = "http://#{ProjectName}.rubyforge.org"
p.author = "John Nunemaker"
p.email = "nunemaker@gmail.com"
p.extra_deps = [['jnunemaker-crack', '>= 0.1.0']]
p.need_tar_gz = false
p.docs_host = WebsitePath
end
Expand Down
175 changes: 0 additions & 175 deletions lib/core_extensions.rb

This file was deleted.

6 changes: 4 additions & 2 deletions lib/httparty.rb
Expand Up @@ -2,8 +2,10 @@

require 'net/http'
require 'net/https'
require 'core_extensions'
require 'httparty/module_inheritable_attributes'
require 'rubygems'
gem 'crack'
require 'crack'

module HTTParty

Expand Down Expand Up @@ -195,7 +197,7 @@ def self.delete(*args)
end

require 'httparty/cookie_hash'
require 'httparty/core_extensions'
require 'httparty/exceptions'
require 'httparty/request'
require 'httparty/response'
require 'httparty/parsers'
25 changes: 25 additions & 0 deletions lib/httparty/core_extensions.rb
@@ -0,0 +1,25 @@
class BlankSlate #:nodoc:
instance_methods.each { |m| undef_method m unless m =~ /^__/ }
end

# 1.8.6 has mistyping of transitive in if statement
require "rexml/document"
module REXML #:nodoc:
class Document < Element #:nodoc:
def write( output=$stdout, indent=-1, transitive=false, ie_hack=false )
if xml_decl.encoding != "UTF-8" && !output.kind_of?(Output)
output = Output.new( output, xml_decl.encoding )
end
formatter = if indent > -1
if transitive
REXML::Formatters::Transitive.new( indent, ie_hack )
else
REXML::Formatters::Pretty.new( indent, ie_hack )
end
else
REXML::Formatters::Default.new( ie_hack )
end
formatter.write( self, output )
end
end
end
4 changes: 0 additions & 4 deletions lib/httparty/parsers.rb

This file was deleted.

74 changes: 0 additions & 74 deletions lib/httparty/parsers/json.rb

This file was deleted.

0 comments on commit 690eeb8

Please sign in to comment.