jnunemaker-httparty 0.2.7 → 0.2.8

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.8 2009-01-28
2
+ * 1 major fix
3
+ * fixed major bug with response where it wouldn't iterate or really work at all with parsed responses
4
+
1
5
  == 0.2.7 2009-01-28
2
6
  * 2 minor fixes, 2 minor enhancements, 2 major enhancements
3
7
  * fixed undefined method add_node for nil class error that occasionally happened (juliocesar)
data/examples/basic.rb CHANGED
@@ -3,4 +3,9 @@ require File.join(dir, 'httparty')
3
3
  require 'pp'
4
4
 
5
5
  # You can also use post, put, delete in the same fashion
6
- pp HTTParty.get('http://twitter.com/statuses/public_timeline.json')
6
+ response = HTTParty.get('http://twitter.com/statuses/public_timeline.json')
7
+ pp response
8
+
9
+ response.each do |item|
10
+ puts item['user']['screen_name']
11
+ end
data/httparty.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{httparty}
5
- s.version = "0.2.7"
5
+ s.version = "0.2.8"
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"]
@@ -11,8 +11,8 @@ Gem::Specification.new do |s|
11
11
  s.description = %q{Makes http fun! Also, makes consuming restful web services dead easy.}
12
12
  s.email = %q{nunemaker@gmail.com}
13
13
  s.executables = ["httparty"]
14
- s.extra_rdoc_files = ["bin/httparty", "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"]
15
- s.files = ["bin/httparty", "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
+ s.extra_rdoc_files = ["bin/httparty", "lib/core_extensions.rb", "lib/httparty/exceptions.rb", "lib/httparty/request.rb", "lib/httparty/response.rb", "lib/httparty/version.rb", "lib/httparty.rb", "lib/module_level_inheritable_attributes.rb", "README"]
15
+ s.files = ["bin/httparty", "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/response.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/empty.xml", "spec/fixtures/google.html", "spec/fixtures/twitter.json", "spec/fixtures/twitter.xml", "spec/fixtures/undefined_method_add_node_for_nil.xml", "spec/httparty/request_spec.rb", "spec/httparty_spec.rb", "spec/spec.opts", "spec/spec_helper.rb", "website/css/common.css", "website/index.html"]
16
16
  s.has_rdoc = true
17
17
  s.homepage = %q{http://httparty.rubyforge.org}
18
18
  s.post_install_message = %q{When you HTTParty, you must party hard!}
@@ -0,0 +1,27 @@
1
+ module HTTParty
2
+ class Response
3
+ attr_accessor :body, :code
4
+
5
+ def initialize(delegate, body, code)
6
+ @delegate = delegate
7
+ @body = body
8
+ @code = code
9
+ end
10
+
11
+ def method_missing(name, *args, &block)
12
+ @delegate.send(name, *args, &block)
13
+ end
14
+
15
+ def ==(other)
16
+ @delegate == other
17
+ end
18
+
19
+ def nil?
20
+ @delegate.nil?
21
+ end
22
+
23
+ def pretty_print(q)
24
+ @delegate.pretty_print(q)
25
+ end
26
+ end
27
+ end
@@ -1,3 +1,3 @@
1
1
  module HTTParty
2
- Version = '0.2.7'
2
+ Version = '0.2.8'
3
3
  end
File without changes
@@ -0,0 +1,2 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <Entities total="0" results="0" page="1" page-size="25" href="https://s3-sandbox.parature.com/api/v1/5578/5633/Account" />
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.7
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Nunemaker
@@ -41,6 +41,7 @@ extra_rdoc_files:
41
41
  - lib/core_extensions.rb
42
42
  - lib/httparty/exceptions.rb
43
43
  - lib/httparty/request.rb
44
+ - lib/httparty/response.rb
44
45
  - lib/httparty/version.rb
45
46
  - lib/httparty.rb
46
47
  - lib/module_level_inheritable_attributes.rb
@@ -59,6 +60,7 @@ files:
59
60
  - lib/core_extensions.rb
60
61
  - lib/httparty/exceptions.rb
61
62
  - lib/httparty/request.rb
63
+ - lib/httparty/response.rb
62
64
  - lib/httparty/version.rb
63
65
  - lib/httparty.rb
64
66
  - lib/module_level_inheritable_attributes.rb
@@ -69,9 +71,11 @@ files:
69
71
  - setup.rb
70
72
  - spec/as_buggery_spec.rb
71
73
  - spec/fixtures/delicious.xml
74
+ - spec/fixtures/empty.xml
72
75
  - spec/fixtures/google.html
73
76
  - spec/fixtures/twitter.json
74
77
  - spec/fixtures/twitter.xml
78
+ - spec/fixtures/undefined_method_add_node_for_nil.xml
75
79
  - spec/httparty/request_spec.rb
76
80
  - spec/httparty_spec.rb
77
81
  - spec/spec.opts