Skip to content

Commit

Permalink
[ARCH] Removed crack dependency and use the perfectly fine JSON gem
Browse files Browse the repository at this point in the history
- Removed XML and YAML parsing
- Why? Because we are using Merb and Merb uses a sane JSON library
  anyways.
  • Loading branch information
hosh committed Apr 18, 2009
1 parent c69fe04 commit 8d1a7ed
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
13 changes: 5 additions & 8 deletions httparty.gemspec
@@ -1,14 +1,14 @@
# -*- encoding: utf-8 -*-

Gem::Specification.new do |s|
s.name = %q{httparty}
s.name = %q{httparty-json}
s.version = "0.4.2"

s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
s.authors = ["John Nunemaker"]
s.date = %q{2009-04-02}
s.default_executable = %q{httparty}
s.description = %q{Makes http fun! Also, makes consuming restful web services dead easy.}
s.description = %q{Makes http fun! Also, makes consuming restful web services dead easy. (this fork adds back json dependency)}
s.email = %q{nunemaker@gmail.com}
s.executables = ["httparty"]
s.extra_rdoc_files = ["bin/httparty", "lib/httparty/cookie_hash.rb", "lib/httparty/core_extensions.rb", "lib/httparty/exceptions.rb", "lib/httparty/module_inheritable_attributes.rb", "lib/httparty/request.rb", "lib/httparty/response.rb", "lib/httparty/version.rb", "lib/httparty.rb", "README"]
Expand All @@ -27,14 +27,11 @@ Gem::Specification.new do |s|
s.specification_version = 2

if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
s.add_runtime_dependency(%q<crack>, [">= 0.1.1"])
s.add_development_dependency(%q<echoe>, [">= 0"])
s.add_runtime_dependency(%q<json>, [">= 1.1.4"])
else
s.add_dependency(%q<crack>, [">= 0.1.1"])
s.add_dependency(%q<echoe>, [">= 0"])
s.add_runtime_dependency(%q<json>, [">= 1.1.4"])
end
else
s.add_dependency(%q<crack>, [">= 0.1.1"])
s.add_dependency(%q<echoe>, [">= 0"])
s.add_runtime_dependency(%q<json>, [">= 1.1.4"])
end
end
2 changes: 0 additions & 2 deletions lib/httparty.rb
Expand Up @@ -4,8 +4,6 @@
require 'net/https'
require 'httparty/module_inheritable_attributes'
require 'rubygems'
gem 'crack'
require 'crack'

module HTTParty

Expand Down
8 changes: 5 additions & 3 deletions lib/httparty/request.rb
Expand Up @@ -107,11 +107,13 @@ def parse_response(body)
return nil if body.nil? or body.empty?
case format
when :xml
Crack::XML.parse(body)
#Crack::XML.parse(body)
throw "XML not supported"
when :json
Crack::JSON.parse(body)
JSON.parse(body)
when :yaml
YAML::load(body)
#YAML::load(body)
throw "YAML not supported"
else
body
end
Expand Down

0 comments on commit 8d1a7ed

Please sign in to comment.