googleoauth 0.0.2 → 0.0.3

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/googleoauth/client.rb +6 -6
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0e714c9ece6fc2c866f58a603b3d62fb0f823411
4
- data.tar.gz: 61de94d37fd3e03f6940db472cc206dbd4fc5ab7
3
+ metadata.gz: e6fcec6d788a6818298b64148136ce1dcc9f1e32
4
+ data.tar.gz: 8dcad01c546cacb75ebd54374fed10251e37cf2a
5
5
  SHA512:
6
- metadata.gz: 018f01fb8d20ccd38d2da387ca45ca036c0a7ea39304124648141c01f245c67ed43459d924b7cd23ca8473d9d3802a2fd1a4faaa5dbde31928a5b5d1781a3fcb
7
- data.tar.gz: cfbbf40672c5e7b7600c335b2fc0cba257f716e7d528a0228ea3fea5377e4942b1a09a106fcbbff22fb3b15b1f012f85a72bdb73d53facd55f20773ced453a0c
6
+ metadata.gz: 02e786ffc2166a2bb8dc319644c71b25e94382163045275df749453dc94f184988611bd109bd104e11bdffd25681594e5b230a5b6e05bc550055eb2903b80685
7
+ data.tar.gz: 8483ed4406b46c4b84e6af3fbf56c8f9e332474bccf2ed11ece1be22fa15556e5df6884332bce2459b50283b8e68f034b0e5201ffc0c960e069182cda08fb9cb
@@ -3,8 +3,8 @@
3
3
  module GoogleOAuth
4
4
  class Client
5
5
 
6
-
7
-
6
+ @@token = nil
7
+
8
8
  def initialize(options = {})
9
9
  @client_id = options[:client_id]
10
10
  @client_secret = options[:client_secret]
@@ -21,14 +21,14 @@ module GoogleOAuth
21
21
  end
22
22
 
23
23
  def authorize(options = {})
24
- consumer.auth_code.get_token(
24
+ @@token = consumer.auth_code.get_token(
25
25
  options[:code],
26
26
  :redirect_uri => @redirect
27
27
  )
28
28
  end
29
29
 
30
- def request(token, request_uri)
31
- token.get(request_uri)
30
+ def request(request_uri)
31
+ @@token.get("https://www.googleapis.com/#{request_uri}".gsub('\/\/', '')).body
32
32
  end
33
33
 
34
34
  private
@@ -36,7 +36,7 @@ module GoogleOAuth
36
36
  OAuth2::Client.new(
37
37
  @client_id,
38
38
  @client_secret,
39
- :site => "https://accounts.google.com",
39
+ :site => 'https://accounts.google.com',
40
40
  :authorize_url => '/o/oauth2/auth',
41
41
  :token_url => '/o/oauth2/token'
42
42
  )
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: googleoauth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - iamdual