omniauth-vkontakte 1.5.1 → 1.6.0

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: 97a799d1a663fd5b32fbb1b5ed00385314955ff3d8af788d37b8949c99402b95
4
- data.tar.gz: dc69884b28a8fce16bb73ec4d06bdf9c63314fba54386ce22d503ce13b097003
3
+ metadata.gz: a66fd112fb2f1d79deedab3d2f7eb3eef303e0e22f827ccdb3174fe50a7f9b8c
4
+ data.tar.gz: 1651a2707b44331710292fa786093762a3b02797067cbb2402f615b44d5aafe7
5
5
  SHA512:
6
- metadata.gz: 619795bc0590021e0fde0044ed06bd8500740f133f68180c53525859863f505cf035e130e958723eb07ed838cc4b1132fdd875e6b97296d28d847a3bea2b9628
7
- data.tar.gz: e7eab5866e9bf03eb1b071a65b603d6adfcb1e421401712ef02b5537618721446d9380ffa45c527ee332bc9241c8e2faa360880a5e3cfe70a983987e04e3b130
6
+ metadata.gz: 72ecf8d314ae1095196f46b23e27b2408145fd25d790e66e04a4c236b0c6d26c0ead47edbe65b059cd9cf1089ce996d437dd9696a625c860d70a5812907557cd
7
+ data.tar.gz: abeaf3b11d33befae097b787e099094ca2c608391d63426de50159d52ccb72507e0038a622ceff527e3a60e8ce1542fc0b4cd2bd0b08e50b65a5efd237f24532
@@ -4,5 +4,8 @@ Metrics/MethodLength:
4
4
  Enabled: false
5
5
  Metrics/BlockLength:
6
6
  Enabled: false
7
-
8
-
7
+ Metrics/ClassLength:
8
+ Max: 101
9
+ Naming/FileName:
10
+ Exclude:
11
+ - 'lib/omniauth-vkontakte.rb'
@@ -1,3 +1,4 @@
1
+ language: ruby
1
2
  before_install:
2
3
  - gem update bundler
3
4
  - bundle --version
@@ -9,3 +10,6 @@ rvm:
9
10
  - 2.4.5
10
11
  - 2.3.8
11
12
  - jruby-head
13
+ script:
14
+ - bundle exec rspec
15
+ - bundle exec rubocop
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  gemspec
data/README.md CHANGED
@@ -27,7 +27,7 @@ Here's a quick example, adding the middleware to a Rails app in `config/initiali
27
27
 
28
28
  ```ruby
29
29
  Rails.application.config.middleware.use OmniAuth::Builder do
30
- provider :vkontakte, ENV['API_KEY'], ENV['API_SECRET']
30
+ provider :vkontakte, ENV['VK_API_ID'], ENV['VK_API_SECRET']
31
31
  end
32
32
  ```
33
33
 
@@ -50,14 +50,12 @@ Here's an example of a possible configuration:
50
50
 
51
51
  ```ruby
52
52
  use OmniAuth::Builder do
53
- provider :vkontakte, ENV['API_KEY'], ENV['API_SECRET'],
54
- {
55
- :scope => 'friends,audio,photos',
56
- :display => 'popup',
57
- :lang => 'en',
58
- :https => 1,
59
- :image_size => 'original'
60
- }
53
+ provider :vkontakte, ENV['VKONTAKTE_KEY'], ENV['VKONTAKTE_SECRET'],
54
+ scope: 'friends,audio,photos',
55
+ display: 'popup',
56
+ lang: 'en',
57
+ https: 1,
58
+ image_size: 'original'
61
59
  end
62
60
  ```
63
61
 
data/Rakefile CHANGED
@@ -1,4 +1,6 @@
1
1
  #!/usr/bin/env rake
2
+ # frozen_string_literal: true
3
+
2
4
  require 'bundler/gem_tasks'
3
5
  require 'rspec/core/rake_task'
4
6
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  gem 'omniauth-vkontakte', path: '../'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler/setup'
2
4
  require_relative 'main'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'pp'
2
4
  require 'sinatra'
3
5
  require 'omniauth'
@@ -5,7 +7,7 @@ require 'omniauth-vkontakte'
5
7
 
6
8
  configure { set :server, :puma }
7
9
 
8
- SCOPE = 'friends,audio'.freeze
10
+ SCOPE = 'friends,audio'
9
11
 
10
12
  use Rack::Session::Cookie
11
13
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'omniauth/vkontakte/version'
2
4
  require 'omniauth'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'omniauth/strategies/oauth2'
2
4
 
3
5
  module OmniAuth
@@ -13,9 +15,9 @@ module OmniAuth
13
15
  class Vkontakte < OmniAuth::Strategies::OAuth2
14
16
  class NoRawData < StandardError; end
15
17
 
16
- API_VERSION = '5.8'.freeze
18
+ API_VERSION = '5.107'
17
19
 
18
- DEFAULT_SCOPE = ''.freeze
20
+ DEFAULT_SCOPE = ''
19
21
 
20
22
  option :name, 'vkontakte'
21
23
 
@@ -56,13 +58,6 @@ module OmniAuth
56
58
  access_token.options[:mode] = :query
57
59
  access_token.options[:param_name] = :access_token
58
60
  @raw_info ||= begin
59
- params = {
60
- fields: info_options,
61
- lang: lang_option,
62
- https: https_option,
63
- v: API_VERSION
64
- }
65
-
66
61
  result = access_token.get('/method/users.get', params: params).parsed['response']
67
62
 
68
63
  raise NoRawData, result unless result.is_a?(Array) && result.first
@@ -95,6 +90,15 @@ module OmniAuth
95
90
 
96
91
  private
97
92
 
93
+ def params
94
+ {
95
+ fields: info_options,
96
+ lang: lang_option,
97
+ https: https_option,
98
+ v: API_VERSION
99
+ }
100
+ end
101
+
98
102
  def callback_url
99
103
  options.redirect_url || (full_host + script_name + callback_path)
100
104
  end
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module OmniAuth
2
4
  module Vkontakte
3
- VERSION = '1.5.1'.freeze
5
+ VERSION = '1.6.0'
4
6
  end
5
7
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.expand_path('lib/omniauth/vkontakte/version', __dir__)
2
4
 
3
5
  Gem::Specification.new do |gem|
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe OmniAuth::Strategies::Vkontakte do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  $LOAD_PATH.unshift File.expand_path(__dir__)
2
4
  $LOAD_PATH.unshift File.expand_path('../lib', __dir__)
3
5
  require 'simplecov'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-vkontakte
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Maminov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-13 00:00:00.000000000 Z
11
+ date: 2020-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth-oauth2