omniauth-ely 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c701afaca89dae0d711ea3ef0dde79175943468c
4
- data.tar.gz: 21949368a63ffc52996c490b970495a8f2a638e6
3
+ metadata.gz: 88664606685defcfe4482e68a7b659f7364f3db2
4
+ data.tar.gz: d5654ef1e7c9670210decfe53098ca3b540f2b49
5
5
  SHA512:
6
- metadata.gz: f733b499d9d4a6644a1752f0509d4473d5caf5bb41a532bd9e2defcb6476ef9fad0ebf83106d88e00dafe8ef75658f2648f7eccd3deb76cecfea04b11d659d77
7
- data.tar.gz: c337c8d06b330c4d4b9a8c193a6943cfcd1ce5b49d314d3006be048d2b41453d882b09a717dab369f5e7b684774c3986a646c3c15f44c0f7091b69dd8cbc7fa0
6
+ metadata.gz: f88f5fed71477fb067c6b797c1959dbf04eadec657cb74c40d6b2fe05c5728d5bc70a353a109fe04a7d33df777f5ce24f3d926381005997be3632d749ad7df77
7
+ data.tar.gz: 41ae7ff5f6ecf635711d39f79fb4b05e63133d310d7af460617e89534d184a8aa223b908d2fe42c1c595b4f2f7df7e50bb40a5ac9897e146b12e72a6edc233c8
data/.gitignore CHANGED
@@ -4,7 +4,6 @@
4
4
  .bundle
5
5
  .config
6
6
  .yardoc
7
- Gemfile.lock
8
7
  InstalledFiles
9
8
  _yardoc
10
9
  coverage
@@ -0,0 +1,118 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ omniauth-ely (0.1.0)
5
+ omniauth (~> 1.0)
6
+ omniauth-oauth2 (>= 1.1.1, < 2.0)
7
+
8
+ GEM
9
+ remote: http://rubygems.org/
10
+ specs:
11
+ addressable (2.5.2)
12
+ public_suffix (>= 2.0.2, < 4.0)
13
+ coderay (1.1.2)
14
+ crack (0.4.3)
15
+ safe_yaml (~> 1.0.0)
16
+ diff-lcs (1.3)
17
+ docile (1.1.5)
18
+ faraday (0.12.2)
19
+ multipart-post (>= 1.2, < 3)
20
+ ffi (1.9.18)
21
+ formatador (0.2.5)
22
+ growl (1.0.3)
23
+ guard (2.14.1)
24
+ formatador (>= 0.2.4)
25
+ listen (>= 2.7, < 4.0)
26
+ lumberjack (~> 1.0)
27
+ nenv (~> 0.1)
28
+ notiffany (~> 0.0)
29
+ pry (>= 0.9.12)
30
+ shellany (~> 0.0)
31
+ thor (>= 0.18.1)
32
+ guard-bundler (2.1.0)
33
+ bundler (~> 1.0)
34
+ guard (~> 2.2)
35
+ guard-compat (~> 1.1)
36
+ guard-compat (1.2.1)
37
+ guard-rspec (4.7.3)
38
+ guard (~> 2.1)
39
+ guard-compat (~> 1.1)
40
+ rspec (>= 2.99.0, < 4.0)
41
+ hashdiff (0.3.7)
42
+ hashie (3.5.6)
43
+ json (2.1.0)
44
+ jwt (1.5.6)
45
+ listen (3.1.5)
46
+ rb-fsevent (~> 0.9, >= 0.9.4)
47
+ rb-inotify (~> 0.9, >= 0.9.7)
48
+ ruby_dep (~> 1.2)
49
+ lumberjack (1.0.12)
50
+ method_source (0.9.0)
51
+ multi_json (1.12.2)
52
+ multi_xml (0.6.0)
53
+ multipart-post (2.0.0)
54
+ nenv (0.3.0)
55
+ notiffany (0.1.1)
56
+ nenv (~> 0.1)
57
+ shellany (~> 0.0)
58
+ oauth2 (1.4.0)
59
+ faraday (>= 0.8, < 0.13)
60
+ jwt (~> 1.0)
61
+ multi_json (~> 1.3)
62
+ multi_xml (~> 0.5)
63
+ rack (>= 1.2, < 3)
64
+ omniauth (1.7.1)
65
+ hashie (>= 3.4.6, < 3.6.0)
66
+ rack (>= 1.6.2, < 3)
67
+ omniauth-oauth2 (1.4.0)
68
+ oauth2 (~> 1.0)
69
+ omniauth (~> 1.2)
70
+ pry (0.11.2)
71
+ coderay (~> 1.1.0)
72
+ method_source (~> 0.9.0)
73
+ public_suffix (3.0.0)
74
+ rack (2.0.3)
75
+ rack-test (0.7.0)
76
+ rack (>= 1.0, < 3)
77
+ rb-fsevent (0.10.2)
78
+ rb-inotify (0.9.10)
79
+ ffi (>= 0.5.0, < 2)
80
+ rspec (2.99.0)
81
+ rspec-core (~> 2.99.0)
82
+ rspec-expectations (~> 2.99.0)
83
+ rspec-mocks (~> 2.99.0)
84
+ rspec-core (2.99.2)
85
+ rspec-expectations (2.99.2)
86
+ diff-lcs (>= 1.1.3, < 2.0)
87
+ rspec-mocks (2.99.4)
88
+ ruby_dep (1.5.0)
89
+ safe_yaml (1.0.4)
90
+ shellany (0.0.1)
91
+ simplecov (0.15.1)
92
+ docile (~> 1.1.0)
93
+ json (>= 1.8, < 3)
94
+ simplecov-html (~> 0.10.0)
95
+ simplecov-html (0.10.2)
96
+ thor (0.20.0)
97
+ webmock (3.1.0)
98
+ addressable (>= 2.3.6)
99
+ crack (>= 0.3.2)
100
+ hashdiff
101
+
102
+ PLATFORMS
103
+ ruby
104
+
105
+ DEPENDENCIES
106
+ growl
107
+ guard
108
+ guard-bundler
109
+ guard-rspec
110
+ omniauth-ely!
111
+ rack-test
112
+ rb-fsevent
113
+ rspec (~> 2.7)
114
+ simplecov
115
+ webmock
116
+
117
+ BUNDLED WITH
118
+ 1.16.0
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Ely
3
- VERSION = '0.1.0'
3
+ VERSION = '0.2.0'
4
4
  end
5
5
  end
@@ -42,6 +42,10 @@ module OmniAuth
42
42
  def profile_url
43
43
  'http://ely.by/u' + raw_info['id'].to_s
44
44
  end
45
+
46
+ def callback_url
47
+ options[:redirect_uri] || (full_host + script_name + callback_path)
48
+ end
45
49
  end
46
50
  end
47
51
  end
@@ -1,50 +1,50 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe OmniAuth::Strategies::Ely do
4
- let(:access_token) { stub('AccessToken', :options => {}) }
5
- let(:parsed_response) { stub('ParsedResponse') }
6
- let(:response) { stub('Response', :parsed => parsed_response) }
4
+ let(:access_token) { double('AccessToken', :options => {}) }
5
+ let(:parsed_response) { double('ParsedResponse') }
6
+ let(:response) { double('Response', :parsed => parsed_response) }
7
7
 
8
8
  subject do
9
9
  OmniAuth::Strategies::Ely.new({})
10
10
  end
11
11
 
12
12
  before(:each) do
13
- subject.stub!(:access_token).and_return(access_token)
13
+ allow(subject).to receive(:access_token).and_return(access_token)
14
14
  end
15
15
 
16
16
  context 'client options' do
17
17
  it 'should have correct site' do
18
- subject.options.client_options.site.should eq('https://account.ely.by')
18
+ expect(subject.options.client_options.site).to eq('https://account.ely.by')
19
19
  end
20
20
 
21
21
  it 'should have correct authorize url' do
22
- subject.options.client_options.authorize_url.should eq('https://account.ely.by/oauth2/v1/')
22
+ expect(subject.options.client_options.authorize_url).to eq('https://account.ely.by/oauth2/v1/')
23
23
  end
24
24
 
25
25
  it 'should have correct token url' do
26
- subject.options.client_options.token_url.should eq('https://account.ely.by/api/oauth2/v1/token')
26
+ expect(subject.options.client_options.token_url).to eq('https://account.ely.by/api/oauth2/v1/token')
27
27
  end
28
28
  end
29
29
 
30
30
  context '#raw_info' do
31
31
  it 'should use relative paths' do
32
- access_token.should_receive(:get).and_return(response)
33
- subject.raw_info.should eq(parsed_response)
32
+ expect(access_token).to receive(:get).and_return(response)
33
+ expect(subject.raw_info).to eq(parsed_response)
34
34
  end
35
35
 
36
36
  it 'should build valid profile link' do
37
37
  raw_info = Hash.new
38
38
  raw_info['id'] = 1
39
- subject.stub!(:raw_info).and_return(raw_info)
40
- subject.profile_url.should eq('http://ely.by/u1')
39
+ allow(subject).to receive(:raw_info).and_return(raw_info)
40
+ expect(subject.profile_url).to eq('http://ely.by/u1')
41
41
  end
42
42
 
43
43
  it 'should build valid skin link' do
44
44
  raw_info = Hash.new
45
45
  raw_info['username'] = 'Steve'
46
- subject.stub!(:raw_info).and_return(raw_info)
47
- subject.skin_url.should eq('http://skinsystem.ely.by/skins/Steve.png')
46
+ allow(subject).to receive(:raw_info).and_return(raw_info)
47
+ expect(subject.skin_url).to eq('http://skinsystem.ely.by/skins/Steve.png')
48
48
  end
49
49
  end
50
50
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-ely
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ely.by team
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-11-24 00:00:00.000000000 Z
12
+ date: 2017-11-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: omniauth
@@ -112,6 +112,7 @@ files:
112
112
  - ".gitignore"
113
113
  - ".rspec"
114
114
  - Gemfile
115
+ - Gemfile.lock
115
116
  - Guardfile
116
117
  - LICENSE.txt
117
118
  - README.md
@@ -142,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
142
143
  version: '0'
143
144
  requirements: []
144
145
  rubyforge_project:
145
- rubygems_version: 2.5.1
146
+ rubygems_version: 2.6.14
146
147
  signing_key:
147
148
  specification_version: 4
148
149
  summary: Official OmniAuth strategy for Ely.by.