yt-auth 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 97e3f1d9311c6bdf1ff0159c3758c8632fc7ba11
4
- data.tar.gz: bd734cf1115761ec0f5ae1ecda390786e2788fa8
3
+ metadata.gz: 710ce4b2631d068119df7df6a9fdd4f69c0b8ac9
4
+ data.tar.gz: 1f9dd810e4b3078db3512405cce20808a0c52f73
5
5
  SHA512:
6
- metadata.gz: 74b7103a71bf2daa3684599321caa24ddda7537d6c20b3fca014f057854c9f067690f8d16ba13cf7f4ee9404a5a90cef2e1625efd6e544d58deb7b35a40b89fc
7
- data.tar.gz: 501af972f4f38fe87af8f6e3660aed39418a17a77c882eac54e9d00510f35881cbbb90f561dc50ba98d99c7a82c259ba5ed153ef6c49011eaabd6c75da412a0c
6
+ metadata.gz: c59c29fcd624154635cf63c6dbb535b13f9e024b097f6ee5b168e9f62b50b106644d99c6b7b096d312bd3c70b6ed4941fa8474a249c1bcaf8cdbf2dccbc2f549
7
+ data.tar.gz: 603725edf347e698a6957b36a4a4d1ddf44c8e62d3a59ea7c1050a2a82120036d7108728e1cbd73baa97e844441831ae9f75ed9b7f13cf37aa0e267ddc2b56b4
@@ -6,6 +6,10 @@ For more information about changelogs, check
6
6
  [Keep a Changelog](http://keepachangelog.com) and
7
7
  [Vandamme](http://tech-angels.github.io/vandamme).
8
8
 
9
+ ## 0.2.2 - 2017-05-31
10
+
11
+ * [FEATURE] Add `Auth#access_token`
12
+
9
13
  ## 0.2.1 - 2017-03-29
10
14
 
11
15
  * [ENHANCEMENT] Speed up process by fetching email with 1 HTTP request (not 2).
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2017 Fullscreen, Inc.
3
+ Copyright (c) 2017-present Fullscreen, Inc.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -16,7 +16,7 @@ The **source code** is available on [GitHub](https://github.com/fullscreen/yt-au
16
16
  [![Online docs](http://img.shields.io/badge/docs-✓-green.svg)](http://www.rubydoc.info/gems/yt-auth/frames)
17
17
  [![Gem Version](http://img.shields.io/gem/v/yt-auth.svg)](http://rubygems.org/gems/yt-auth)
18
18
 
19
- The Yt::Auth class provides two public methods: `url` and `email`.
19
+ The Yt::Auth class provides three public methods: `url`, `email`, and `access_token`.
20
20
 
21
21
  Yt::Auth#url
22
22
  ------------
@@ -46,6 +46,18 @@ Yt::Auth.new(redirect_uri: redirect_uri, code: code).email
46
46
  # => "user@example.com"
47
47
  ```
48
48
 
49
+ Yt::Auth#access_token
50
+ ---------------------
51
+
52
+ Similarly, with the `access_token` method, you can obtain an access token of the users:
53
+
54
+ ```ruby
55
+ redirect_uri = 'https://example.com/auth' # REPLACE WITH REAL ONE
56
+ code = '1234' # REPLACE WITH REAL ONE
57
+ Yt::Auth.new(redirect_uri: redirect_uri, code: code).access_token
58
+ # => "ya29.GltbBLXt74GrwX8S_xr70aX"
59
+ ```
60
+
49
61
  Yt::HTTPError
50
62
  -------------
51
63
 
@@ -31,6 +31,11 @@ module Yt
31
31
  profile['email']
32
32
  end
33
33
 
34
+ # @return [String] the access token of an authenticated Google account.
35
+ def access_token
36
+ tokens['access_token']
37
+ end
38
+
34
39
  private
35
40
 
36
41
  def url_params
@@ -1,6 +1,6 @@
1
1
  module Yt
2
2
  class Auth
3
3
  # current version of gem
4
- VERSION = '0.2.1'
4
+ VERSION = '0.2.2'
5
5
  end
6
6
  end
@@ -17,7 +17,9 @@ Gem::Specification.new do |spec|
17
17
 
18
18
  spec.required_ruby_version = '>= 2.2.2'
19
19
 
20
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
20
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
21
+ f.match(%r{^(test|spec|features)/})
22
+ end
21
23
  spec.bindir = 'exe'
22
24
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
25
  spec.require_paths = ['lib']
@@ -27,8 +29,8 @@ Gem::Specification.new do |spec|
27
29
 
28
30
  spec.add_development_dependency 'bundler', '~> 1.14'
29
31
  spec.add_development_dependency 'rspec', '~> 3.5'
30
- spec.add_development_dependency 'rake', '~> 10.0'
31
- spec.add_development_dependency 'coveralls', '~> 0.8.15'
32
+ spec.add_development_dependency 'rake', '~> 12.0'
33
+ spec.add_development_dependency 'coveralls', '~> 0.8.20'
32
34
  spec.add_development_dependency 'pry-nav', '~> 0.2.4'
33
- spec.add_development_dependency 'yard', '~> 0.9.5'
35
+ spec.add_development_dependency 'yard', '~> 0.9.8'
34
36
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yt-auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claudio Baccigalupo
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2017-03-29 00:00:00.000000000 Z
12
+ date: 2017-05-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: yt-support
@@ -73,28 +73,28 @@ dependencies:
73
73
  requirements:
74
74
  - - "~>"
75
75
  - !ruby/object:Gem::Version
76
- version: '10.0'
76
+ version: '12.0'
77
77
  type: :development
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
81
  - - "~>"
82
82
  - !ruby/object:Gem::Version
83
- version: '10.0'
83
+ version: '12.0'
84
84
  - !ruby/object:Gem::Dependency
85
85
  name: coveralls
86
86
  requirement: !ruby/object:Gem::Requirement
87
87
  requirements:
88
88
  - - "~>"
89
89
  - !ruby/object:Gem::Version
90
- version: 0.8.15
90
+ version: 0.8.20
91
91
  type: :development
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
95
  - - "~>"
96
96
  - !ruby/object:Gem::Version
97
- version: 0.8.15
97
+ version: 0.8.20
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: pry-nav
100
100
  requirement: !ruby/object:Gem::Requirement
@@ -115,14 +115,14 @@ dependencies:
115
115
  requirements:
116
116
  - - "~>"
117
117
  - !ruby/object:Gem::Version
118
- version: 0.9.5
118
+ version: 0.9.8
119
119
  type: :development
120
120
  prerelease: false
121
121
  version_requirements: !ruby/object:Gem::Requirement
122
122
  requirements:
123
123
  - - "~>"
124
124
  - !ruby/object:Gem::Version
125
- version: 0.9.5
125
+ version: 0.9.8
126
126
  description: |-
127
127
  Yt::Auth makes it easy to authenticate users to any
128
128
  web application by means of their Google account.