httparty 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of httparty might be problematic. Click here for more details.

data/History CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.2.1 2008-12-08
2
+ * 1 bug fix
3
+ * Fixed that HTTParty was borking ActiveSupport and as such Rails (thanks to Rob Sanheim)
4
+
1
5
  == 0.2.0 2008-12-07
2
6
  * 1 major enhancement
3
7
  * Removed ActiveSupport as a dependency. Now requires json gem for json deserialization and uses an included class to do the xml parsing.
data/Manifest CHANGED
@@ -18,6 +18,7 @@ MIT-LICENSE
18
18
  Rakefile
19
19
  README
20
20
  setup.rb
21
+ spec/as_buggery_spec.rb
21
22
  spec/fixtures/delicious.xml
22
23
  spec/fixtures/google.html
23
24
  spec/fixtures/twitter.json
@@ -2,15 +2,15 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{httparty}
5
- s.version = "0.2.0"
5
+ s.version = "0.2.1"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["John Nunemaker"]
9
- s.date = %q{2008-12-07}
9
+ s.date = %q{2008-12-08}
10
10
  s.description = %q{Makes http fun! Also, makes consuming restful web services dead easy.}
11
11
  s.email = %q{nunemaker@gmail.com}
12
12
  s.extra_rdoc_files = ["lib/core_extensions.rb", "lib/httparty/exceptions.rb", "lib/httparty/request.rb", "lib/httparty/version.rb", "lib/httparty.rb", "lib/module_level_inheritable_attributes.rb", "README"]
13
- s.files = ["examples/aaws.rb", "examples/basic.rb", "examples/delicious.rb", "examples/google.rb", "examples/rubyurl.rb", "examples/twitter.rb", "examples/whoismyrep.rb", "History", "httparty.gemspec", "lib/core_extensions.rb", "lib/httparty/exceptions.rb", "lib/httparty/request.rb", "lib/httparty/version.rb", "lib/httparty.rb", "lib/module_level_inheritable_attributes.rb", "Manifest", "MIT-LICENSE", "Rakefile", "README", "setup.rb", "spec/fixtures/delicious.xml", "spec/fixtures/google.html", "spec/fixtures/twitter.json", "spec/fixtures/twitter.xml", "spec/httparty/request_spec.rb", "spec/httparty_spec.rb", "spec/spec.opts", "spec/spec_helper.rb", "website/css/common.css", "website/index.html"]
13
+ s.files = ["examples/aaws.rb", "examples/basic.rb", "examples/delicious.rb", "examples/google.rb", "examples/rubyurl.rb", "examples/twitter.rb", "examples/whoismyrep.rb", "History", "httparty.gemspec", "lib/core_extensions.rb", "lib/httparty/exceptions.rb", "lib/httparty/request.rb", "lib/httparty/version.rb", "lib/httparty.rb", "lib/module_level_inheritable_attributes.rb", "Manifest", "MIT-LICENSE", "Rakefile", "README", "setup.rb", "spec/as_buggery_spec.rb", "spec/fixtures/delicious.xml", "spec/fixtures/google.html", "spec/fixtures/twitter.json", "spec/fixtures/twitter.xml", "spec/httparty/request_spec.rb", "spec/httparty_spec.rb", "spec/spec.opts", "spec/spec_helper.rb", "website/css/common.css", "website/index.html"]
14
14
  s.has_rdoc = true
15
15
  s.homepage = %q{http://httparty.rubyforge.org}
16
16
  s.post_install_message = %q{When you HTTParty, you must party hard!}
@@ -285,11 +285,7 @@ class ToHashParser
285
285
  end
286
286
  end
287
287
 
288
- class Hash
289
- def self.from_xml(xml)
290
- ToHashParser.from_xml(xml)
291
- end
292
-
288
+ class Hash
293
289
  # @return <String> This hash as a query string
294
290
  #
295
291
  # @example
@@ -95,7 +95,7 @@ module HTTParty
95
95
  return nil if body.nil? or body.empty?
96
96
  case format
97
97
  when :xml
98
- Hash.from_xml(body)
98
+ ToHashParser.from_xml(body)
99
99
  when :json
100
100
  JSON.parse(body)
101
101
  else
@@ -1,3 +1,3 @@
1
1
  module HTTParty
2
- Version = '0.2.0'
2
+ Version = '0.2.1'
3
3
  end
@@ -0,0 +1,16 @@
1
+ require File.join(File.dirname(__FILE__), 'spec_helper')
2
+
3
+ require 'activesupport'
4
+
5
+ describe Hash do
6
+ describe "#from_xml" do
7
+ it "should be able to convert xml with datetimes" do
8
+ xml =<<EOL
9
+ <?xml version="1.0" encoding="UTF-8"?>
10
+ <created-at type="datetime">2008-12-01T20:00:00-05:00</created-at>
11
+ EOL
12
+ hsh = Hash.from_xml(xml)
13
+ hsh["created_at"].should == Time.parse("December 01st, 2008 20:00:00")
14
+ end
15
+ end
16
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: httparty
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Nunemaker
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-12-07 00:00:00 -05:00
12
+ date: 2008-12-08 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -67,6 +67,7 @@ files:
67
67
  - Rakefile
68
68
  - README
69
69
  - setup.rb
70
+ - spec/as_buggery_spec.rb
70
71
  - spec/fixtures/delicious.xml
71
72
  - spec/fixtures/google.html
72
73
  - spec/fixtures/twitter.json