googlebase 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/History.txt CHANGED
@@ -1,3 +1,4 @@
1
+ * 0.1.2 - added raw_data option to post method
1
2
  * 0.1.1 - added post request method
2
3
  - refactored get to take a hash which will automatically be converted to a query string
3
4
  - added in a bit more documentation for methods including the new post method
data/lib/google/base.rb CHANGED
@@ -60,12 +60,22 @@ module Google
60
60
  #
61
61
  # Usage:
62
62
  # post('http://google.com/some/thing', :form_data => {:one => '1', :two => '2'})
63
- # # makes a post request to http://google.com/some/thing with the form data set to one=1&two=2
63
+ # # makes a post request to http://google.com/some/thing with the post data set to one=1&two=2
64
+ # post('http://google.com/some/thing', :raw_data => "some=thing&another=thing")
65
+ # # makes a post request to http://google.com/some/thing with the post data set to some=thing&another=thing
64
66
  def post(url, o={})
65
67
  options = {
66
68
  :form_data => nil,
69
+ :raw_data => nil,
67
70
  }.merge(o)
68
- request 'post', url, options
71
+ if options[:raw_data]
72
+ url = URI.parse(url)
73
+ http = Net::HTTP.new(url.host, url.port)
74
+ result = http.request_post(url.request_uri, options[:raw_data], @@connection.headers)
75
+ result.body
76
+ else
77
+ request 'post', url, options
78
+ end
69
79
  end
70
80
 
71
81
  private
@@ -2,7 +2,7 @@ module Google #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- TINY = 1
5
+ TINY = 2
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: googlebase
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ""
6
6
  authors:
7
7
  - John
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2007-11-25 00:00:00 -05:00
12
+ date: 2007-12-26 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies: []
15
15