omniauth-discord 0.1.8 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1,10 +1,7 @@
1
1
  require 'bundler/gem_tasks'
2
- require 'rake/testtask'
2
+ require 'rspec/core/rake_task'
3
3
 
4
- Rake::TestTask.new do |task|
5
- task.libs << 'lib'
6
- task.libs << 'test'
7
- task.test_files = FileList['test/*_test.rb']
8
- end
4
+ RSpec::Core::RakeTask.new
9
5
 
10
- task :default => :test
6
+ desc 'Run specs'
7
+ task default: :spec
@@ -1,2 +1,2 @@
1
1
  require 'omniauth/discord/version'
2
- require 'omniauth/strategies/discord'
2
+ require 'omniauth/strategies/discord'
@@ -1,5 +1,5 @@
1
1
  module Omniauth
2
2
  module Discord
3
- VERSION = "0.1.8"
3
+ VERSION = '1.0.0'.freeze
4
4
  end
5
5
  end
@@ -3,25 +3,24 @@ require 'omniauth-oauth2'
3
3
  module OmniAuth
4
4
  module Strategies
5
5
  class Discord < OmniAuth::Strategies::OAuth2
6
- DEFAULT_SCOPE = 'identify'
6
+ DEFAULT_SCOPE = 'identify'.freeze
7
7
 
8
8
  option :name, 'discord'
9
9
 
10
- option :client_options, {
11
- :site => 'https://discordapp.com/api',
12
- :authorize_url => 'oauth2/authorize',
13
- :token_url => 'oauth2/token'
14
- }
10
+ option :client_options,
11
+ site: 'https://discordapp.com/api',
12
+ authorize_url: 'oauth2/authorize',
13
+ token_url: 'oauth2/token'
15
14
 
16
- option :authorize_options, [:scope, :permissions]
15
+ option :authorize_options, %i[scope permissions]
17
16
 
18
17
  uid { raw_info['id'] }
19
18
 
20
19
  info do
21
20
  {
22
- :name => raw_info['username'],
23
- :email => raw_info['verified'] ? raw_info['email'] : nil,
24
- :image => "https://cdn.discordapp.com/avatars/#{raw_info['id']}/#{raw_info['avatar']}"
21
+ name: raw_info['username'],
22
+ email: raw_info['verified'] ? raw_info['email'] : nil,
23
+ image: "https://cdn.discordapp.com/avatars/#{raw_info['id']}/#{raw_info['avatar']}"
25
24
  }
26
25
  end
27
26
 
@@ -46,7 +45,6 @@ module OmniAuth
46
45
  params[option] = request.params[option.to_s] if request.params[option.to_s]
47
46
  end
48
47
 
49
- params[:redirect_uri] = options[:redirect_uri] unless options[:redirect_uri].nil?
50
48
  params[:scope] ||= DEFAULT_SCOPE
51
49
  end
52
50
  end
@@ -1,28 +1,27 @@
1
- # coding: utf-8
2
- $:.push File.expand_path('../lib', __FILE__)
1
+ $LOAD_PATH.push File.expand_path('lib', __dir__)
3
2
  require 'omniauth/discord/version'
4
3
 
5
4
  Gem::Specification.new do |spec|
6
- spec.name = "omniauth-discord"
5
+ spec.name = 'omniauth-discord'
7
6
  spec.version = Omniauth::Discord::VERSION
8
- spec.authors = ["Adão Raul"]
9
- spec.email = ["adao.raul@gmail.com"]
7
+ spec.authors = ['Adão Raul']
8
+ spec.email = ['adao.raul@gmail.com']
10
9
 
11
- spec.summary = "Discord OAuth2 Strategy for OmniAuth"
10
+ spec.summary = 'Discord OAuth2 Strategy for OmniAuth'
12
11
  spec.description = spec.summary
13
- spec.homepage = "http://github.com/adaoraul/omniauth-discord"
14
- spec.license = "MIT"
12
+ spec.homepage = 'http://github.com/adaoraul/omniauth-discord'
13
+ spec.license = 'MIT'
15
14
 
16
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
15
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(spec)/}) }
17
16
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
17
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
- spec.require_paths = ["lib"]
18
+ spec.require_paths = ['lib']
20
19
 
21
- spec.add_runtime_dependency 'omniauth-oauth2', '~> 1.4'
20
+ spec.add_runtime_dependency 'omniauth'
21
+ spec.add_runtime_dependency 'omniauth-oauth2'
22
22
 
23
- spec.add_development_dependency "dotenv"
24
- spec.add_development_dependency "bundler"
25
- spec.add_development_dependency "rake"
26
- spec.add_development_dependency "minitest-utils"
27
- spec.add_development_dependency "mocha"
23
+ spec.add_development_dependency 'rack-test'
24
+ spec.add_development_dependency 'rspec'
25
+ spec.add_development_dependency 'simplecov'
26
+ spec.add_development_dependency 'webmock'
28
27
  end
metadata CHANGED
@@ -1,37 +1,37 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-discord
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adão Raul
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-11 00:00:00.000000000 Z
11
+ date: 2019-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: omniauth-oauth2
14
+ name: omniauth
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.4'
19
+ version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '1.4'
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: dotenv
28
+ name: omniauth-oauth2
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
- type: :development
34
+ type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
@@ -39,7 +39,7 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: bundler
42
+ name: rack-test
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
@@ -53,7 +53,7 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: rake
56
+ name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - ">="
@@ -67,7 +67,7 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: minitest-utils
70
+ name: simplecov
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ">="
@@ -81,7 +81,7 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: mocha
84
+ name: webmock
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - ">="
@@ -132,8 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
132
132
  - !ruby/object:Gem::Version
133
133
  version: '0'
134
134
  requirements: []
135
- rubyforge_project:
136
- rubygems_version: 2.7.6
135
+ rubygems_version: 3.0.1
137
136
  signing_key:
138
137
  specification_version: 4
139
138
  summary: Discord OAuth2 Strategy for OmniAuth