jnunemaker-httparty 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -6,6 +6,7 @@ examples/rubyurl.rb
6
6
  examples/twitter.rb
7
7
  examples/whoismyrep.rb
8
8
  History
9
+ httparty.gemspec
9
10
  lib/core_extensions.rb
10
11
  lib/httparty/exceptions.rb
11
12
  lib/httparty/request.rb
@@ -17,6 +18,7 @@ MIT-LICENSE
17
18
  Rakefile
18
19
  README
19
20
  setup.rb
21
+ spec/as_buggery_spec.rb
20
22
  spec/fixtures/delicious.xml
21
23
  spec/fixtures/google.html
22
24
  spec/fixtures/twitter.json
data/httparty.gemspec CHANGED
@@ -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: jnunemaker-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 -08:00
12
+ date: 2008-12-08 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -65,6 +65,7 @@ files:
65
65
  - Rakefile
66
66
  - README
67
67
  - setup.rb
68
+ - spec/as_buggery_spec.rb
68
69
  - spec/fixtures/delicious.xml
69
70
  - spec/fixtures/google.html
70
71
  - spec/fixtures/twitter.json