omniauth-matique 0.1.5 → 0.1.7

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
  SHA256:
3
- metadata.gz: 717942741d02e474b4028898fe9655ee0b2a3edfe4934d66747f50a635d7dc4b
4
- data.tar.gz: 5c22be58d56513e990e536874800902e57d753f6f9bc4035d6fc14902c3f17d9
3
+ metadata.gz: e48cb0b561ff78279781e9b5cef8619f4167cf4d631cfe3b8bf8c6f1c9a65343
4
+ data.tar.gz: 2e843cc7a3f4ac5226e722dadec8bb13d816b6b35044315193dc41a9031f7ae4
5
5
  SHA512:
6
- metadata.gz: 2a38371f0cb009e68e21aec3f724371f17f1060aa9772b4b4117ab4133931a92a0ba0cf871e6221764993fa353fb2328266096ae44ce9bb72acb49cb93b3f2e4
7
- data.tar.gz: ac04a8079f6dc78c0c744bde9a7a3c2905032508d7a1b5f4c40f69df4e12358bb8c304f9a7c0acd1def63390f8b7e83028ee4e49ca389dad00347f1fe7a409eb
6
+ metadata.gz: 36f3b583714621b43fc2019c8c944b2ac166dd240635d0e1bb4b520b609ae4a4b50d56ba9b35d972e896b20ddb0264c71f0357e2127ebf5d8554dcfa1ca94ef5
7
+ data.tar.gz: 20fef38023b607218daaa159e6f9bc39f71700639f6c3c635f9979bd0fbc21d555425e61cd72621fe21be4812d6d79862ab191eeb3ee5092beca0aa30e028ac6
@@ -0,0 +1,11 @@
1
+ inherit_from:
2
+ - ~/configs/.rubocop.yml
3
+
4
+ AllCops:
5
+ Include:
6
+ - 'lib/**/*.rb'
7
+ Exclude:
8
+ - 'test/**/*'
9
+
10
+ Layout/HashAlignment:
11
+ Enabled: false
@@ -1 +1 @@
1
- ruby-2.6.4
1
+ ruby-2.6.6
@@ -6,14 +6,16 @@ bundler_args: --without production
6
6
  script: 'bundle exec rake test'
7
7
 
8
8
  rvm:
9
- - 2.6.4
9
+ - 2.6.6
10
+ # - 2.6.5
11
+ # - 2.6.4
10
12
  # - 2.6.3
11
13
  # - 2.6.1
12
14
  # - 2.5.1
13
15
  # - 2.4.1
14
16
  # - 2.3.0
15
17
  # - 2.2.3
16
- - 2.0.0
18
+ # - 2.0.0
17
19
 
18
20
  notifications:
19
21
  email: false
data/.watchr CHANGED
@@ -16,37 +16,30 @@ end
16
16
 
17
17
  def run_it(type, file)
18
18
  case type
19
- when 'test'; run %Q{ruby -I"lib:test" -rubygems #{file}}
20
- # when 'test'; run %Q{rails test #{file}}
21
- when 'spec'; run %Q{rspec -X #{file}}
19
+ when 'test'; run %(ruby -I test #{file})
20
+ # when 'spec'; run %(rspec -X #{file})
22
21
  else; puts "#{H} unknown type: #{type}, file: #{file}"
23
22
  end
24
23
  end
25
24
 
26
25
  def run_all_tests
27
26
  puts "\n#{HH} Running all tests #{HH}\n"
28
- # system "spring stop"
29
- %w{test}.each { |dir| run "rake #{dir} RAILS_ENV=test" if File.exists?(dir) }
30
- %w{spec}.each { |dir| run "rake #{dir} RAILS_ENV=test" if File.exists?(dir) }
27
+ %w[test spec].each { |dir| run "rake #{dir}" if File.exist?(dir) }
31
28
  end
32
29
 
33
30
  def run_matching_files(base)
34
31
  base = base.split('_').first
35
- %w{test spec}.each { |type|
32
+ %w[test spec].each { |type|
36
33
  files = Dir["#{type}/**/*.rb"].select { |file| file =~ /#{base}_.*\.rb/ }
37
34
  run_it type, files.join(' ') unless files.empty?
38
35
  }
39
36
  end
40
37
 
41
- %w{test spec}.each { |type|
38
+ %w[test spec].each { |type|
42
39
  watch("#{type}/#{type}_helper\.rb") { run_all_tests }
40
+ watch('lib/.*\.rb') { run_all_tests }
43
41
  watch("#{type}/.*/*_#{type}\.rb") { |match| run_it type, match[0] }
44
42
  }
45
- %w{rb erb haml slim}.each { |type|
46
- watch("app/.*/(.*)\.#{type}") { |match|
47
- run_matching_files(match[1])
48
- }
49
- }
50
43
 
51
44
  # Ctrl-\ or ctrl-4
52
45
  Signal.trap('QUIT') { run_all_tests }
data/Gemfile CHANGED
@@ -1,6 +1,10 @@
1
1
  source 'https://rubygems.org'
2
2
  gemspec
3
3
 
4
- group :development, :test do
4
+ gem 'rails'
5
+
6
+ group :test do
5
7
  gem 'observr'
8
+ gem 'rubocop', require: false
9
+ gem 'simplecov', require: false
6
10
  end
@@ -1,4 +1,4 @@
1
- Copyright 2016-2019 Dittmar Krall http://matique.de
1
+ Copyright 2016-2020 Dittmar Krall www.matique.com
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/Rakefile CHANGED
@@ -1,11 +1,11 @@
1
- require 'bundler/setup'
2
- require 'bundler/gem_tasks'
3
1
  require 'rake/testtask'
4
2
 
5
- Rake::TestTask.new(:test) do |t|
3
+ desc 'Run the tests.'
4
+ Rake::TestTask.new do |t|
5
+ t.libs << 'lib'
6
6
  t.libs << 'test'
7
7
  t.pattern = 'test/**/*_test.rb'
8
- t.verbose = true
8
+ t.verbose = false
9
9
  end
10
10
 
11
- task :default => :test
11
+ task default: :test
@@ -1,2 +1,4 @@
1
- require "omniauth-matique/version"
1
+ # rubocop: disable all
2
+
3
+ require 'omniauth-matique/version'
2
4
  require 'omniauth/strategies/matique'
@@ -1,7 +1,11 @@
1
+ # rubocop: disable all
2
+
1
3
  module OmniAuth
2
4
  module Matique
3
- VERSION = '0.1.5' # 2019-10-06
4
- # VERSION = '0.1.4' # 2019-03-02
5
- # VERSION = '0.1.3'
5
+ VERSION = '0.1.7' # 2020-07-17
6
+ # VERSION = '0.1.6' # 2020-04-27
7
+ # VERSION = '0.1.5' # 2019-10-06
8
+ # VERSION = '0.1.4' # 2019-03-02
9
+ # VERSION = '0.1.3'
6
10
  end
7
11
  end
@@ -1,35 +1,40 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'omniauth-oauth2'
2
4
 
3
5
  module OmniAuth
4
6
  module Strategies
5
7
  class Matique < OmniAuth::Strategies::OAuth2
6
- # AuthUrl = ENV["HEROKU_AUTH_URL"] || "https://id.heroku.com"
7
- AUTH_URL = ENV["AUTH_URL"] || 'http://localhost:3010'
8
- # AUTH_URL = 'https://login.matique.de'
8
+ # AUTH_URL = 'https://login.matique.de'
9
+ AUTH_URL = ENV['AUTH_URL'] || 'http://localhost:3010'
9
10
  STRATEGY = 'matique'
10
11
 
11
12
  option :client_options, {
12
- site: AUTH_URL,
13
- authorize_url: "#{AUTH_URL}/auth/#{STRATEGY}/authorize",
14
- token_url: "#{AUTH_URL}/auth/#{STRATEGY}/access_token"
13
+ site: AUTH_URL,
14
+ authorize_url: "#{AUTH_URL}/auth/#{STRATEGY}/authorize",
15
+ token_url: "#{AUTH_URL}/auth/#{STRATEGY}/access_token"
15
16
  }
16
17
 
17
- uid { raw_info['id'] }
18
+ uid { raw_info['id'].to_s }
18
19
 
19
20
  info do
20
- { 'email' => raw_info['email'] }
21
+ {
22
+ name: raw_info['name'],
23
+ username: raw_info['username'],
24
+ email: raw_info['email'],
25
+ image: raw_info['avatar_url']
26
+ }
21
27
  end
22
28
 
23
29
  extra do
24
- { 'raw_info' => raw_info }
30
+ {raw_info: raw_info}
25
31
  end
26
32
 
27
33
  def raw_info
28
- @raw_info ||= access_token.get(
29
- "/auth/matique/user.json?oauth_token=#{access_token.token}").
30
- parsed || {}
34
+ @raw_info ||= access_token.get(
35
+ "/auth/matique/user.json?oauth_token=#{access_token.token}"
36
+ ).parsed || {}
31
37
  end
32
-
33
38
  end
34
39
  end
35
40
  end
@@ -21,11 +21,9 @@ Gem::Specification.new do |s|
21
21
  s.require_paths = ['lib']
22
22
 
23
23
  s.add_development_dependency 'bundler'
24
- s.add_development_dependency 'rake', '~> 12'
24
+ s.add_development_dependency 'rake', '~> 13'
25
25
  s.add_dependency 'omniauth-oauth2', '~> 1'
26
26
 
27
- s.add_development_dependency 'minitest'
28
- s.add_development_dependency 'mocha'
29
- s.add_development_dependency 'simplecov'
30
- s.add_development_dependency 'sqlite3'
27
+ s.add_development_dependency 'minitest', '~> 5'
28
+ s.add_development_dependency 'mocha', '~> 1'
31
29
  end
@@ -45,9 +45,8 @@ describe OmniAuth::Strategies::Matique do
45
45
  end
46
46
 
47
47
  it 'access email from the raw_info' do
48
- assert_equal 'test@example.com', strategy.info['email']
49
- # coverage
50
- refute_nil strategy.extra['raw_info']
48
+ assert_equal 'test@example.com', strategy.info[:email]
49
+ refute_nil strategy.extra[:raw_info]
51
50
  end
52
51
  end
53
52
  end
@@ -1,9 +1,13 @@
1
- require 'simplecov'
2
- SimpleCov.start
1
+ if ENV['COVERAGE']
2
+ require 'simplecov'
3
+ SimpleCov.start do
4
+ add_filter '/test/'
5
+ end
6
+ end
3
7
 
4
8
  require 'bundler/setup'
5
9
  require 'minitest/autorun'
6
- require 'mocha/setup'
10
+ require 'mocha/minitest'
7
11
  require 'omniauth/strategies/matique'
8
12
 
9
13
  OmniAuth.config.test_mode = true
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-matique
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dittmar Krall
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-06 00:00:00.000000000 Z
11
+ date: 2020-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '12'
33
+ version: '13'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '12'
40
+ version: '13'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: omniauth-oauth2
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -56,58 +56,30 @@ dependencies:
56
56
  name: minitest
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: '5'
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: '0'
68
+ version: '5'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: mocha
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: '0'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: '0'
83
- - !ruby/object:Gem::Dependency
84
- name: simplecov
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '0'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: '0'
97
- - !ruby/object:Gem::Dependency
98
- name: sqlite3
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - ">="
73
+ - - "~>"
102
74
  - !ruby/object:Gem::Version
103
- version: '0'
75
+ version: '1'
104
76
  type: :development
105
77
  prerelease: false
106
78
  version_requirements: !ruby/object:Gem::Requirement
107
79
  requirements:
108
- - - ">="
80
+ - - "~>"
109
81
  - !ruby/object:Gem::Version
110
- version: '0'
82
+ version: '1'
111
83
  description: " Strategy to authenticate with matique UG via OAuth2 in OmniAuth.\n"
112
84
  email:
113
85
  - dittmar.krall@matique.de
@@ -116,6 +88,7 @@ extensions: []
116
88
  extra_rdoc_files: []
117
89
  files:
118
90
  - ".gitignore"
91
+ - ".rubocop.yml"
119
92
  - ".ruby-gemset"
120
93
  - ".ruby-version"
121
94
  - ".travis.yml"
@@ -151,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
151
124
  - !ruby/object:Gem::Version
152
125
  version: '0'
153
126
  requirements: []
154
- rubygems_version: 3.0.6
127
+ rubygems_version: 3.1.4
155
128
  signing_key:
156
129
  specification_version: 4
157
130
  summary: OmniAuth strategy for matique