twitch_oauth2 0.1.0 → 0.2.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/README.md +29 -17
- data/lib/twitch_oauth2/client.rb +25 -15
- data/lib/twitch_oauth2/version.rb +1 -1
- metadata +50 -42
- data/.cirrus.yml +0 -32
- data/.editorconfig +0 -17
- data/.gitignore +0 -2
- data/.rspec +0 -3
- data/.rubocop.yml +0 -47
- data/Gemfile +0 -6
- data/Rakefile +0 -8
- data/twitch_oauth2.gemspec +0 -57
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3dafbbd8897dad15761967a8ff1d9842438948cc88c753955e1d3c121b0fb4f8
|
4
|
+
data.tar.gz: 1cad9f6de68da7ab3f0052aab03f57dac98122b0e542dae33f75a29d7a379462
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0736d7951b1ad4c0faa6b8b582fd22966096a8bd7b038996e104c0414ae80903f27653adf8e9b6a71c663c6f795cc138ae544905ff45067b8d9f26fb61f6990
|
7
|
+
data.tar.gz: 94e1bad7e2b47eaf0d2dce14e73f7a08a1525e0b9bffa788789f66a428a4bbe9e18e71b338dd3de4a7d1cc8db4a792329096ab0f6e691354c47b655821153c2b
|
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -1,9 +1,17 @@
|
|
1
1
|
# TwitchOAuth2
|
2
2
|
|
3
|
+
[](https://cirrus-ci.com/github/AlexWayfer/twitch_oauth2)
|
4
|
+
[](https://codecov.io/gh/AlexWayfer/twitch_oauth2)
|
5
|
+
[](https://codeclimate.com/github/AlexWayfer/twitch_oauth2)
|
6
|
+
[](https://depfu.com/repos/github/AlexWayfer/twitch_oauth2)
|
7
|
+
[](https://inch-ci.org/github/AlexWayfer/twitch_oauth2)
|
8
|
+
[](https://github.com/AlexWayfer/twitch_oauth2/blob/master/LICENSE.txt)
|
9
|
+
[](https://rubygems.org/gems/twitch_oauth2)
|
10
|
+
|
3
11
|
Twitch authentication with OAuth 2.
|
4
12
|
Result tokens can be used for API libraries, chat libraries or something else.
|
5
13
|
|
6
|
-
[Twitch Authentication Documentation]
|
14
|
+
[Twitch Authentication Documentation](https://dev.twitch.tv/docs/authentication)
|
7
15
|
|
8
16
|
## Installation
|
9
17
|
|
@@ -47,14 +55,24 @@ tokens = previously_saved_tokens
|
|
47
55
|
# => { access_token: 'abcdef', refresh_token: 'ghikjl' }
|
48
56
|
# Can be empty.
|
49
57
|
|
50
|
-
client.check_tokens **tokens
|
58
|
+
client.check_tokens **tokens, token_type: :user
|
51
59
|
```
|
52
60
|
|
61
|
+
`:token_type` is optional and is `:application` by default,
|
62
|
+
but a number of available API end-points is limited in this case.
|
63
|
+
|
64
|
+
Also, Application Access Token has no `refresh_token`, but this gem just receive a new one
|
65
|
+
if a given one is invalid.
|
66
|
+
|
53
67
|
#### The first run
|
54
68
|
|
55
69
|
You can pass nothing to `#check_tokens`, then client will generate new ones.
|
56
|
-
|
57
|
-
|
70
|
+
|
71
|
+
If you've specified `:token_type` as `:application` or have not specify it at all (default),
|
72
|
+
there will be an Application Access Token (without refresh token).
|
73
|
+
|
74
|
+
Otherwise, for User Access Token you will be asked to open a Twitch link in a browser
|
75
|
+
and login as user for whom tokens are intended.
|
58
76
|
|
59
77
|
#### Reusing tokens
|
60
78
|
|
@@ -72,22 +90,18 @@ client.refreshed_tokens refresh_token: 'ghikjl'
|
|
72
90
|
This is used internally in `#check_tokens`, and can be used separately
|
73
91
|
for failed requests to API.
|
74
92
|
|
93
|
+
And, because Application Access Tokens have no refresh tokens — this method will not work for them.
|
94
|
+
|
75
95
|
## Development
|
76
96
|
|
77
97
|
After checking out the repo, run `bundle install` to install dependencies.
|
78
|
-
Then, run `bundle exec rake spec` to run the tests.
|
79
98
|
|
80
|
-
|
81
|
-
with filtered sensitive data, so you don't need for real credentials
|
82
|
-
(like Twitch Client ID and Client Secret) for changing existing methods,
|
83
|
-
but you need for them to add new requests.
|
84
|
-
You can read how to get them [here][Twitch Authentication Documentation].
|
99
|
+
Then, run `toys rspec` to run the tests.
|
85
100
|
|
86
|
-
To install this gem onto your local machine, run `
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
to [rubygems.org](https://rubygems.org).
|
101
|
+
To install this gem onto your local machine, run `toys gem install`.
|
102
|
+
|
103
|
+
To release a new version, run `toys gem release %version%`.
|
104
|
+
See how it works [here](https://github.com/AlexWayfer/gem_toys#release).
|
91
105
|
|
92
106
|
## Contributing
|
93
107
|
|
@@ -97,5 +111,3 @@ Bug reports and pull requests are welcome on [GitHub](https://github.com/AlexWay
|
|
97
111
|
|
98
112
|
The gem is available as open source under the terms of the
|
99
113
|
[MIT License](https://opensource.org/licenses/MIT).
|
100
|
-
|
101
|
-
[Twitch Authentication Documentation]: https://dev.twitch.tv/docs/authentication
|
data/lib/twitch_oauth2/client.rb
CHANGED
@@ -26,24 +26,20 @@ module TwitchOAuth2
|
|
26
26
|
@client_secret = client_secret
|
27
27
|
@redirect_uri = redirect_uri
|
28
28
|
@scopes = scopes
|
29
|
-
|
30
|
-
@state = SecureRandom.alphanumeric(32)
|
31
29
|
end
|
32
30
|
|
33
|
-
def check_tokens(access_token: nil, refresh_token: nil)
|
31
|
+
def check_tokens(access_token: nil, refresh_token: nil, token_type: :user)
|
34
32
|
if access_token
|
35
33
|
validate_result = validate access_token: access_token
|
36
34
|
|
37
35
|
if validate_result[:status] == 401
|
38
|
-
return refreshed_tokens(refresh_token: refresh_token)
|
39
|
-
|
40
|
-
|
41
|
-
if validate_result[:expires_in].positive?
|
36
|
+
return refreshed_tokens(refresh_token: refresh_token) if token_type == :user
|
37
|
+
elsif validate_result[:expires_in].positive?
|
42
38
|
return { access_token: access_token, refresh_token: refresh_token }
|
43
39
|
end
|
44
40
|
end
|
45
41
|
|
46
|
-
flow
|
42
|
+
flow token_type: token_type
|
47
43
|
end
|
48
44
|
|
49
45
|
def refreshed_tokens(refresh_token:)
|
@@ -52,7 +48,13 @@ module TwitchOAuth2
|
|
52
48
|
|
53
49
|
private
|
54
50
|
|
55
|
-
def flow
|
51
|
+
def flow(token_type:)
|
52
|
+
code = request_code if token_type == :user
|
53
|
+
|
54
|
+
token(code: code, token_type: token_type).slice(:access_token, :refresh_token)
|
55
|
+
end
|
56
|
+
|
57
|
+
def request_code
|
56
58
|
link = authorize
|
57
59
|
|
58
60
|
puts <<~TEXT
|
@@ -63,9 +65,7 @@ module TwitchOAuth2
|
|
63
65
|
4. Insert below:
|
64
66
|
TEXT
|
65
67
|
|
66
|
-
|
67
|
-
|
68
|
-
token(code: code).slice(:access_token, :refresh_token)
|
68
|
+
$stdin.gets.chomp
|
69
69
|
end
|
70
70
|
|
71
71
|
def authorize
|
@@ -83,17 +83,27 @@ module TwitchOAuth2
|
|
83
83
|
raise Error, response.body[:message]
|
84
84
|
end
|
85
85
|
|
86
|
-
def token(code:)
|
86
|
+
def token(code:, token_type:)
|
87
87
|
response = CONNECTION.post(
|
88
88
|
'token',
|
89
89
|
client_id: @client_id,
|
90
90
|
client_secret: @client_secret,
|
91
91
|
code: code,
|
92
|
-
grant_type:
|
92
|
+
grant_type: grant_type_by_token_type(token_type),
|
93
93
|
redirect_uri: @redirect_uri
|
94
94
|
)
|
95
95
|
|
96
|
-
response.body
|
96
|
+
return response.body if response.success?
|
97
|
+
|
98
|
+
raise Error, response.body[:message]
|
99
|
+
end
|
100
|
+
|
101
|
+
def grant_type_by_token_type(token_type)
|
102
|
+
case token_type
|
103
|
+
when :user then :authorization_code
|
104
|
+
when :application then :client_credentials
|
105
|
+
else raise Error, 'unsupported token type'
|
106
|
+
end
|
97
107
|
end
|
98
108
|
|
99
109
|
def validate(access_token:)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twitch_oauth2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Popov
|
8
|
-
autorequire:
|
9
|
-
bindir:
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-11-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -39,61 +39,75 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: pry-byebug
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: '3.9'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: '3.9'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: bundler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: '2.0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: '2.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: gem_toys
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: 0.4.0
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
82
|
+
version: 0.4.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: toys
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: 0.11.0
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
96
|
+
version: 0.11.0
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: codecov
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 0.2.1
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 0.2.1
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
112
|
name: rspec
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -109,75 +123,75 @@ dependencies:
|
|
109
123
|
- !ruby/object:Gem::Version
|
110
124
|
version: '3.9'
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
126
|
+
name: simplecov
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
114
128
|
requirements:
|
115
129
|
- - "~>"
|
116
130
|
- !ruby/object:Gem::Version
|
117
|
-
version: 0.
|
131
|
+
version: 0.19.0
|
118
132
|
type: :development
|
119
133
|
prerelease: false
|
120
134
|
version_requirements: !ruby/object:Gem::Requirement
|
121
135
|
requirements:
|
122
136
|
- - "~>"
|
123
137
|
- !ruby/object:Gem::Version
|
124
|
-
version: 0.
|
138
|
+
version: 0.19.0
|
125
139
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
140
|
+
name: vcr
|
127
141
|
requirement: !ruby/object:Gem::Requirement
|
128
142
|
requirements:
|
129
143
|
- - "~>"
|
130
144
|
- !ruby/object:Gem::Version
|
131
|
-
version: '
|
145
|
+
version: '6.0'
|
132
146
|
type: :development
|
133
147
|
prerelease: false
|
134
148
|
version_requirements: !ruby/object:Gem::Requirement
|
135
149
|
requirements:
|
136
150
|
- - "~>"
|
137
151
|
- !ruby/object:Gem::Version
|
138
|
-
version: '
|
152
|
+
version: '6.0'
|
139
153
|
- !ruby/object:Gem::Dependency
|
140
|
-
name: rubocop
|
154
|
+
name: rubocop
|
141
155
|
requirement: !ruby/object:Gem::Requirement
|
142
156
|
requirements:
|
143
157
|
- - "~>"
|
144
158
|
- !ruby/object:Gem::Version
|
145
|
-
version:
|
159
|
+
version: 0.93.1
|
146
160
|
type: :development
|
147
161
|
prerelease: false
|
148
162
|
version_requirements: !ruby/object:Gem::Requirement
|
149
163
|
requirements:
|
150
164
|
- - "~>"
|
151
165
|
- !ruby/object:Gem::Version
|
152
|
-
version:
|
166
|
+
version: 0.93.1
|
153
167
|
- !ruby/object:Gem::Dependency
|
154
|
-
name:
|
168
|
+
name: rubocop-performance
|
155
169
|
requirement: !ruby/object:Gem::Requirement
|
156
170
|
requirements:
|
157
171
|
- - "~>"
|
158
172
|
- !ruby/object:Gem::Version
|
159
|
-
version:
|
173
|
+
version: '1.0'
|
160
174
|
type: :development
|
161
175
|
prerelease: false
|
162
176
|
version_requirements: !ruby/object:Gem::Requirement
|
163
177
|
requirements:
|
164
178
|
- - "~>"
|
165
179
|
- !ruby/object:Gem::Version
|
166
|
-
version:
|
180
|
+
version: '1.0'
|
167
181
|
- !ruby/object:Gem::Dependency
|
168
|
-
name:
|
182
|
+
name: rubocop-rspec
|
169
183
|
requirement: !ruby/object:Gem::Requirement
|
170
184
|
requirements:
|
171
185
|
- - "~>"
|
172
186
|
- !ruby/object:Gem::Version
|
173
|
-
version: '
|
187
|
+
version: '1.44'
|
174
188
|
type: :development
|
175
189
|
prerelease: false
|
176
190
|
version_requirements: !ruby/object:Gem::Requirement
|
177
191
|
requirements:
|
178
192
|
- - "~>"
|
179
193
|
- !ruby/object:Gem::Version
|
180
|
-
version: '
|
194
|
+
version: '1.44'
|
181
195
|
description: |
|
182
196
|
Twitch authentication with OAuth 2.
|
183
197
|
Result tokens can be used for API libraries, chat libraries
|
@@ -188,27 +202,21 @@ executables: []
|
|
188
202
|
extensions: []
|
189
203
|
extra_rdoc_files: []
|
190
204
|
files:
|
191
|
-
-
|
192
|
-
- ".editorconfig"
|
193
|
-
- ".gitignore"
|
194
|
-
- ".rspec"
|
195
|
-
- ".rubocop.yml"
|
196
|
-
- Gemfile
|
205
|
+
- CHANGELOG.md
|
197
206
|
- LICENSE.txt
|
198
207
|
- README.md
|
199
|
-
- Rakefile
|
200
208
|
- lib/twitch_oauth2.rb
|
201
209
|
- lib/twitch_oauth2/client.rb
|
202
210
|
- lib/twitch_oauth2/error.rb
|
203
211
|
- lib/twitch_oauth2/version.rb
|
204
|
-
- twitch_oauth2.gemspec
|
205
212
|
homepage: https://github.com/AlexWayfer/twitch_oauth2
|
206
213
|
licenses:
|
207
214
|
- MIT
|
208
215
|
metadata:
|
209
216
|
source_code_uri: https://github.com/AlexWayfer/twitch_oauth2
|
210
217
|
homepage_uri: https://github.com/AlexWayfer/twitch_oauth2
|
211
|
-
|
218
|
+
changelog_uri: https://github.com/AlexWayfer/twitch_oauth2/blob/master/CHANGELOG.md
|
219
|
+
post_install_message:
|
212
220
|
rdoc_options: []
|
213
221
|
require_paths:
|
214
222
|
- lib
|
@@ -223,8 +231,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
223
231
|
- !ruby/object:Gem::Version
|
224
232
|
version: '0'
|
225
233
|
requirements: []
|
226
|
-
rubygems_version: 3.1.
|
227
|
-
signing_key:
|
234
|
+
rubygems_version: 3.1.4
|
235
|
+
signing_key:
|
228
236
|
specification_version: 4
|
229
237
|
summary: Twitch authentication with OAuth 2.
|
230
238
|
test_files: []
|
data/.cirrus.yml
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
bundle_cache: &bundle_cache
|
2
|
-
bundle_cache:
|
3
|
-
folder: /usr/local/bundle
|
4
|
-
fingerprint_script:
|
5
|
-
- echo $CIRRUS_OS
|
6
|
-
- ruby -v
|
7
|
-
- cat Gemfile
|
8
|
-
- cat *.gemspec
|
9
|
-
install_script: bundle update
|
10
|
-
|
11
|
-
test_task:
|
12
|
-
container:
|
13
|
-
matrix:
|
14
|
-
image: ruby:2.5
|
15
|
-
image: ruby:2.6
|
16
|
-
image: ruby:2.7
|
17
|
-
<<: *bundle_cache
|
18
|
-
environment:
|
19
|
-
CODECOV_TOKEN: ENCRYPTED[b26ecd3e49540f09f5c9bf830caa29f5daedaf6769d6b1ba1a650eb6e81432ffb857f19421aed8e8dfddf21724fb57b6]
|
20
|
-
test_script: bundle exec rake
|
21
|
-
|
22
|
-
rubocop_task:
|
23
|
-
container:
|
24
|
-
image: ruby:latest
|
25
|
-
<<: *bundle_cache
|
26
|
-
rubocop_script: bundle exec rubocop
|
27
|
-
|
28
|
-
markdown_lint_task:
|
29
|
-
container:
|
30
|
-
image: ruby:latest
|
31
|
-
<<: *bundle_cache
|
32
|
-
rubocop_script: bundle exec mdl .
|
data/.editorconfig
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
root = true
|
2
|
-
|
3
|
-
[*]
|
4
|
-
indent_style = tab
|
5
|
-
indent_size = 2
|
6
|
-
end_of_line = lf
|
7
|
-
charset = utf-8
|
8
|
-
trim_trailing_whitespace = true
|
9
|
-
insert_final_newline = true
|
10
|
-
|
11
|
-
[*.y{a,}ml]
|
12
|
-
indent_style = space
|
13
|
-
indent_size = 2
|
14
|
-
|
15
|
-
[*.md]
|
16
|
-
indent_style = space
|
17
|
-
indent_size = 4
|
data/.gitignore
DELETED
data/.rspec
DELETED
data/.rubocop.yml
DELETED
@@ -1,47 +0,0 @@
|
|
1
|
-
require:
|
2
|
-
- rubocop-performance
|
3
|
-
- rubocop-rspec
|
4
|
-
|
5
|
-
Layout/IndentationStyle:
|
6
|
-
EnforcedStyle: tabs
|
7
|
-
IndentationWidth: 2
|
8
|
-
Layout/IndentationWidth:
|
9
|
-
Width: 1
|
10
|
-
Layout/MultilineMethodCallIndentation:
|
11
|
-
EnforcedStyle: indented
|
12
|
-
Layout/ArgumentAlignment:
|
13
|
-
EnforcedStyle: with_fixed_indentation
|
14
|
-
Layout/SpaceAroundMethodCallOperator:
|
15
|
-
Enabled: true
|
16
|
-
Layout/EmptyLinesAroundAttributeAccessor:
|
17
|
-
Enabled: true
|
18
|
-
|
19
|
-
Lint/StructNewOverride:
|
20
|
-
Enabled: true
|
21
|
-
Lint/RaiseException:
|
22
|
-
Enabled: true
|
23
|
-
|
24
|
-
Style/HashEachMethods:
|
25
|
-
Enabled: true
|
26
|
-
Style/HashTransformKeys:
|
27
|
-
Enabled: true
|
28
|
-
Style/HashTransformValues:
|
29
|
-
Enabled: true
|
30
|
-
Style/ExponentialNotation:
|
31
|
-
Enabled: true
|
32
|
-
Style/SlicingWithRange:
|
33
|
-
Enabled: true
|
34
|
-
|
35
|
-
Metrics/BlockLength:
|
36
|
-
Exclude:
|
37
|
-
- '*.gemspec'
|
38
|
-
- spec/**/*.rb
|
39
|
-
|
40
|
-
AllCops:
|
41
|
-
TargetRubyVersion: 2.5
|
42
|
-
|
43
|
-
RSpec/FilePath:
|
44
|
-
CustomTransform:
|
45
|
-
TwitchOAuth2: twitch_oauth2
|
46
|
-
RSpec/NestedGroups:
|
47
|
-
Max: 4
|
data/Gemfile
DELETED
data/Rakefile
DELETED
data/twitch_oauth2.gemspec
DELETED
@@ -1,57 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative 'lib/twitch_oauth2/version'
|
4
|
-
|
5
|
-
Gem::Specification.new do |spec|
|
6
|
-
spec.name = 'twitch_oauth2'
|
7
|
-
spec.version = TwitchOAuth2::VERSION
|
8
|
-
spec.authors = ['Alexander Popov']
|
9
|
-
spec.email = ['alex.wayfer@gmail.com']
|
10
|
-
|
11
|
-
spec.summary = 'Twitch authentication with OAuth 2.'
|
12
|
-
spec.description = <<~DESC
|
13
|
-
Twitch authentication with OAuth 2.
|
14
|
-
Result tokens can be used for API libraries, chat libraries
|
15
|
-
or something else.
|
16
|
-
DESC
|
17
|
-
spec.license = 'MIT'
|
18
|
-
|
19
|
-
spec.required_ruby_version = '>= 2.5'
|
20
|
-
|
21
|
-
source_code_uri = 'https://github.com/AlexWayfer/twitch_oauth2'
|
22
|
-
|
23
|
-
spec.homepage = source_code_uri
|
24
|
-
|
25
|
-
spec.metadata['source_code_uri'] = source_code_uri
|
26
|
-
|
27
|
-
spec.metadata['homepage_uri'] = spec.homepage
|
28
|
-
|
29
|
-
# TODO: Put your gem's CHANGELOG.md URL here.
|
30
|
-
# spec.metadata["changelog_uri"] = ""
|
31
|
-
|
32
|
-
# Specify which files should be added to the gem when it is released.
|
33
|
-
# The `git ls-files -z` loads the files in the RubyGem that have been added
|
34
|
-
# into git.
|
35
|
-
spec.files = Dir.chdir(__dir__) do
|
36
|
-
`git ls-files -z`.split("\x0").reject do |file|
|
37
|
-
file.match(%r{^(test|spec|features)/})
|
38
|
-
end
|
39
|
-
end
|
40
|
-
spec.bindir = 'exe'
|
41
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |file| File.basename(file) }
|
42
|
-
spec.require_paths = ['lib']
|
43
|
-
|
44
|
-
spec.add_dependency 'faraday', '~> 1.0'
|
45
|
-
spec.add_dependency 'faraday_middleware', '~> 1.0'
|
46
|
-
|
47
|
-
spec.add_development_dependency 'codecov', '~> 0.1.0'
|
48
|
-
spec.add_development_dependency 'mdl', '~> 0.9.0'
|
49
|
-
spec.add_development_dependency 'pry-byebug', '~> 3.9'
|
50
|
-
spec.add_development_dependency 'rake', '~> 13.0'
|
51
|
-
spec.add_development_dependency 'rspec', '~> 3.9'
|
52
|
-
spec.add_development_dependency 'rubocop', '~> 0.83.0'
|
53
|
-
spec.add_development_dependency 'rubocop-performance', '~> 1.0'
|
54
|
-
spec.add_development_dependency 'rubocop-rspec', '~> 1.0'
|
55
|
-
spec.add_development_dependency 'simplecov', '~> 0.18.0'
|
56
|
-
spec.add_development_dependency 'vcr', '~> 5.1'
|
57
|
-
end
|