signet 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.2.1
2
+
3
+ * Updated to keep in sync with the new httpadapter changes
4
+
1
5
  == 0.2.0
2
6
 
3
7
  * Added support for OAuth 2.0 draft 10
@@ -587,7 +587,7 @@ module Signet
587
587
  # The Authorization realm. See RFC 2617.
588
588
  # - <code>:adapter</code> —
589
589
  # The HTTP adapter.
590
- # Defaults to <code>HTTPAdapter::NetHTTPRequestAdapter</code>.
590
+ # Defaults to <code>HTTPAdapter::NetHTTPAdapter.new</code>.
591
591
  # - <code>:connection</code> —
592
592
  # An open, manually managed HTTP connection.
593
593
  # Must be of type <code>HTTPAdapter::Connection</code> and the
@@ -607,11 +607,11 @@ module Signet
607
607
  unless adapter
608
608
  require 'httpadapter'
609
609
  require 'httpadapter/adapters/net_http'
610
- adapter = HTTPAdapter::NetHTTPRequestAdapter
610
+ adapter = HTTPAdapter::NetHTTPAdapter.new
611
611
  end
612
612
  connection = options[:connection]
613
613
  request = self.generate_temporary_credential_request(options)
614
- response = HTTPAdapter.transmit(request, adapter, connection)
614
+ response = adapter.transmit(request, connection)
615
615
  status, headers, body = response
616
616
  merged_body = StringIO.new
617
617
  body.each do |chunk|
@@ -657,7 +657,7 @@ module Signet
657
657
  # The Authorization realm. See RFC 2617.
658
658
  # - <code>:adapter</code> —
659
659
  # The HTTP adapter.
660
- # Defaults to <code>HTTPAdapter::NetHTTPRequestAdapter</code>.
660
+ # Defaults to <code>HTTPAdapter::NetHTTPAdapter.new</code>.
661
661
  # - <code>:connection</code> —
662
662
  # An open, manually managed HTTP connection.
663
663
  # Must be of type <code>HTTPAdapter::Connection</code> and the
@@ -762,7 +762,7 @@ module Signet
762
762
  # The Authorization realm. See RFC 2617.
763
763
  # - <code>:adapter</code> —
764
764
  # The HTTP adapter.
765
- # Defaults to <code>HTTPAdapter::NetHTTPRequestAdapter</code>.
765
+ # Defaults to <code>HTTPAdapter::NetHTTPAdapter.new</code>.
766
766
  # - <code>:connection</code> —
767
767
  # An open, manually managed HTTP connection.
768
768
  # Must be of type <code>HTTPAdapter::Connection</code> and the
@@ -780,11 +780,11 @@ module Signet
780
780
  unless adapter
781
781
  require 'httpadapter'
782
782
  require 'httpadapter/adapters/net_http'
783
- adapter = HTTPAdapter::NetHTTPRequestAdapter
783
+ adapter = HTTPAdapter::NetHTTPAdapter.new
784
784
  end
785
785
  connection = options[:connection]
786
786
  request = self.generate_token_credential_request(options)
787
- response = HTTPAdapter.transmit(request, adapter, connection)
787
+ response = adapter.transmit(request, connection)
788
788
  status, headers, body = response
789
789
  merged_body = StringIO.new
790
790
  body.each do |chunk|
@@ -830,7 +830,7 @@ module Signet
830
830
  # The Authorization realm. See RFC 2617.
831
831
  # - <code>:adapter</code> —
832
832
  # The HTTP adapter.
833
- # Defaults to <code>HTTPAdapter::NetHTTPRequestAdapter</code>.
833
+ # Defaults to <code>HTTPAdapter::NetHTTPAdapter.new</code>.
834
834
  # - <code>:connection</code> —
835
835
  # An open, manually managed HTTP connection.
836
836
  # Must be of type <code>HTTPAdapter::Connection</code> and the
@@ -895,9 +895,8 @@ module Signet
895
895
  if options[:request]
896
896
  if options[:request].kind_of?(Array)
897
897
  request = options[:request]
898
- elsif options[:adapter] || options[:request].respond_to?(:to_ary)
899
- request =
900
- HTTPAdapter.adapt_request(options[:request], options[:adapter])
898
+ elsif options[:adapter]
899
+ request = options[:adapter].adapt_request(options[:request])
901
900
  end
902
901
  method, uri, headers, body = request
903
902
  else
@@ -992,7 +991,7 @@ module Signet
992
991
  # The Authorization realm. See RFC 2617.
993
992
  # - <code>:adapter</code> —
994
993
  # The HTTP adapter.
995
- # Defaults to <code>HTTPAdapter::NetHTTPRequestAdapter</code>.
994
+ # Defaults to <code>HTTPAdapter::NetHTTPAdapter.new</code>.
996
995
  # - <code>:connection</code> —
997
996
  # An open, manually managed HTTP connection.
998
997
  # Must be of type <code>HTTPAdapter::Connection</code> and the
@@ -1012,7 +1011,7 @@ module Signet
1012
1011
  # :request => Typhoeus::Request.new(
1013
1012
  # 'http://www.example.com/protected/resource'
1014
1013
  # ),
1015
- # :adapter => HTTPAdapter::TyphoeusRequestAdapter,
1014
+ # :adapter => HTTPAdapter::TyphoeusAdapter.new,
1016
1015
  # :connection => connection
1017
1016
  # )
1018
1017
  # status, headers, body = response
@@ -1023,11 +1022,11 @@ module Signet
1023
1022
  unless adapter
1024
1023
  require 'httpadapter'
1025
1024
  require 'httpadapter/adapters/net_http'
1026
- adapter = HTTPAdapter::NetHTTPRequestAdapter
1025
+ adapter = HTTPAdapter::NetHTTPAdapter.new
1027
1026
  end
1028
1027
  connection = options[:connection]
1029
1028
  request = self.generate_authenticated_request(options)
1030
- response = HTTPAdapter.transmit(request, adapter, connection)
1029
+ response = adapter.transmit(request, connection)
1031
1030
  status, headers, body = response
1032
1031
  merged_body = StringIO.new
1033
1032
  body.each do |chunk|
@@ -646,11 +646,11 @@ module Signet
646
646
  unless adapter
647
647
  require 'httpadapter'
648
648
  require 'httpadapter/adapters/net_http'
649
- adapter = HTTPAdapter::NetHTTPRequestAdapter
649
+ adapter = HTTPAdapter::NetHTTPAdapter.new
650
650
  end
651
651
  connection = options[:connection]
652
652
  request = self.generate_access_token_request
653
- response = HTTPAdapter.transmit(request, adapter, connection)
653
+ response = adapter.transmit(request, connection)
654
654
  status, headers, body = response
655
655
  merged_body = StringIO.new
656
656
  body.each do |chunk|
@@ -722,9 +722,8 @@ module Signet
722
722
  if options[:request]
723
723
  if options[:request].kind_of?(Array)
724
724
  request = options[:request]
725
- elsif options[:adapter] || options[:request].respond_to?(:to_ary)
726
- request =
727
- HTTPAdapter.adapt_request(options[:request], options[:adapter])
725
+ elsif options[:adapter]
726
+ request = options[:adapter].adapt_request(options[:request])
728
727
  end
729
728
  method, uri, headers, body = request
730
729
  else
@@ -790,7 +789,7 @@ module Signet
790
789
  # The Authorization realm. See RFC 2617.
791
790
  # - <code>:adapter</code> —
792
791
  # The HTTP adapter.
793
- # Defaults to <code>HTTPAdapter::NetHTTPRequestAdapter</code>.
792
+ # Defaults to <code>HTTPAdapter::NetHTTPAdapter.new</code>.
794
793
  # - <code>:connection</code> —
795
794
  # An open, manually managed HTTP connection.
796
795
  # Must be of type <code>HTTPAdapter::Connection</code> and the
@@ -810,7 +809,7 @@ module Signet
810
809
  # :request => Typhoeus::Request.new(
811
810
  # 'http://www.example.com/protected/resource'
812
811
  # ),
813
- # :adapter => HTTPAdapter::TyphoeusRequestAdapter,
812
+ # :adapter => HTTPAdapter::TyphoeusAdapter.new,
814
813
  # :connection => connection
815
814
  # )
816
815
  # status, headers, body = response
@@ -821,11 +820,11 @@ module Signet
821
820
  unless adapter
822
821
  require 'httpadapter'
823
822
  require 'httpadapter/adapters/net_http'
824
- adapter = HTTPAdapter::NetHTTPRequestAdapter
823
+ adapter = HTTPAdapter::NetHTTPAdapter.new
825
824
  end
826
825
  connection = options[:connection]
827
826
  request = self.generate_authenticated_request(options)
828
- response = HTTPAdapter.transmit(request, adapter, connection)
827
+ response = adapter.transmit(request, connection)
829
828
  status, headers, body = response
830
829
  merged_body = StringIO.new
831
830
  body.each do |chunk|
@@ -18,7 +18,7 @@ unless defined? Signet::VERSION
18
18
  module VERSION
19
19
  MAJOR = 0
20
20
  MINOR = 2
21
- TINY = 0
21
+ TINY = 1
22
22
 
23
23
  STRING = [MAJOR, MINOR, TINY].join('.')
24
24
  end
@@ -15,6 +15,7 @@
15
15
  require 'spec_helper'
16
16
 
17
17
  require 'signet/oauth_1/client'
18
+ require 'httpadapter'
18
19
  require 'httpadapter/adapters/typhoeus'
19
20
  require 'stringio'
20
21
 
@@ -63,7 +64,7 @@ describe Signet::OAuth1::Client, 'configured for standard Google APIs' do
63
64
  :join => [:run, [], nil]
64
65
  )
65
66
  @client.fetch_temporary_credential!(
66
- :adapter => HTTPAdapter::TyphoeusRequestAdapter,
67
+ :adapter => HTTPAdapter::TyphoeusAdapter.new,
67
68
  :connection => connection,
68
69
  :additional_parameters => {
69
70
  :scope => 'https://www.google.com/m8/feeds/'
@@ -131,7 +132,7 @@ describe Signet::OAuth1::Client, 'configured for standard Google APIs' do
131
132
  @client.temporary_credential_secret = '8E1BF0J6ovMva0j87atj/tTG'
132
133
  @client.fetch_token_credential!(
133
134
  :verifier => 'XbVKagBShNsAGBRJWoC4gtFR',
134
- :adapter => HTTPAdapter::TyphoeusRequestAdapter,
135
+ :adapter => HTTPAdapter::TyphoeusAdapter.new,
135
136
  :connection => connection,
136
137
  :additional_parameters => {
137
138
  :scope => 'https://www.google.com/m8/feeds/'
@@ -162,7 +163,7 @@ describe Signet::OAuth1::Client, 'configured for standard Google APIs' do
162
163
  @client.temporary_credential_secret = '8E1BF0J6ovMva0j87atj/tTG'
163
164
  @client.fetch_token_credential!(
164
165
  :verifier => 'XbVKagBShNsAGBRJWoC4gtFR',
165
- :adapter => HTTPAdapter::TyphoeusRequestAdapter,
166
+ :adapter => HTTPAdapter::TyphoeusAdapter.new,
166
167
  :connection => connection,
167
168
  :additional_parameters => {
168
169
  :scope => 'https://www.google.com/m8/feeds/'
@@ -190,7 +191,7 @@ describe Signet::OAuth1::Client, 'configured for standard Google APIs' do
190
191
  '1/YFw6UH2Dn7W691-qAbCfsmqEHQrPb7ptIvYx9m6YkUQ'
191
192
  @client.token_credential_secret = 'Ew3YHAY4bcBryiOUvbdHGa57'
192
193
  response = @client.fetch_protected_resource(
193
- :adapter => HTTPAdapter::TyphoeusRequestAdapter,
194
+ :adapter => HTTPAdapter::TyphoeusAdapter.new,
194
195
  :connection => connection,
195
196
  :uri =>
196
197
  'http://www-opensocial.googleusercontent.com/api/people/@me/@self'
@@ -221,7 +222,7 @@ describe Signet::OAuth1::Client, 'configured for standard Google APIs' do
221
222
  '1/YFw6UH2Dn7W691-qAbCfsmqEHQrPb7ptIvYx9m6YkUQ'
222
223
  @client.token_credential_secret = 'Ew3YHAY4bcBryiOUvbdHGa57'
223
224
  response = @client.fetch_protected_resource(
224
- :adapter => HTTPAdapter::TyphoeusRequestAdapter,
225
+ :adapter => HTTPAdapter::TyphoeusAdapter.new,
225
226
  :connection => connection,
226
227
  :request => Typhoeus::Request.new(
227
228
  'http://www-opensocial.googleusercontent.com/api/people/@me/@self',
data/tasks/gem.rake CHANGED
@@ -22,7 +22,7 @@ namespace :gem do
22
22
  s.extra_rdoc_files = %w( README )
23
23
  s.rdoc_options.concat ["--main", "README"]
24
24
 
25
- s.add_runtime_dependency("httpadapter", "~> 0.2.0")
25
+ s.add_runtime_dependency("httpadapter", "~> 1.0.0")
26
26
  s.add_runtime_dependency("addressable", "~> 2.2.1")
27
27
  s.add_runtime_dependency("json", "~> 1.5.0")
28
28
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: signet
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 0
10
- version: 0.2.0
9
+ - 1
10
+ version: 0.2.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Bob Aman
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-21 00:00:00 -08:00
18
+ date: 2011-03-14 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -28,10 +28,10 @@ dependencies:
28
28
  - !ruby/object:Gem::Version
29
29
  hash: 23
30
30
  segments:
31
+ - 1
31
32
  - 0
32
- - 2
33
33
  - 0
34
- version: 0.2.0
34
+ version: 1.0.0
35
35
  type: :runtime
36
36
  version_requirements: *id001
37
37
  - !ruby/object:Gem::Dependency