omniauth-twitter 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/omniauth-twitter/version.rb +1 -1
- data/lib/omniauth/strategies/twitter.rb +2 -1
- data/spec/omniauth/strategies/twitter_spec.rb +44 -0
- metadata +14 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d1aa4d88d98d1dfa98c1d03abdb8658fa4e601cd
|
4
|
+
data.tar.gz: d411c41a41b8d30b68eb2c940aa958111c40776f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a37391920ba8493d88b03af92618dd5a85896d665ace5e50a9b4f600dd239f0027dc65b748dd4376f1ab054f0117df7a5fd11305dae9f0cd1982a4a591a97493
|
7
|
+
data.tar.gz: 3f39ced0e87f57d8515585f392f9ec83a10ed4782e5b2509d4f9aa1847c7e286db7d5f0501e26a9e057995ddfe183579c13a6141bb5bd10e9a9f73ace631e412
|
@@ -16,6 +16,7 @@ module OmniAuth
|
|
16
16
|
{
|
17
17
|
:nickname => raw_info['screen_name'],
|
18
18
|
:name => raw_info['name'],
|
19
|
+
:email => raw_info["email"],
|
19
20
|
:location => raw_info['location'],
|
20
21
|
:image => image_url,
|
21
22
|
:description => raw_info['description'],
|
@@ -31,7 +32,7 @@ module OmniAuth
|
|
31
32
|
end
|
32
33
|
|
33
34
|
def raw_info
|
34
|
-
@raw_info ||= JSON.load(access_token.get('/1.1/account/verify_credentials.json?include_entities=false&skip_status=true').body)
|
35
|
+
@raw_info ||= JSON.load(access_token.get('/1.1/account/verify_credentials.json?include_entities=false&skip_status=true&include_email=true').body)
|
35
36
|
rescue ::Errno::ETIMEDOUT
|
36
37
|
raise ::Timeout::Error
|
37
38
|
end
|
@@ -26,6 +26,37 @@ describe OmniAuth::Strategies::Twitter do
|
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
+
describe 'info' do
|
30
|
+
before do
|
31
|
+
allow(subject).to receive(:raw_info).and_return(raw_info_hash)
|
32
|
+
end
|
33
|
+
|
34
|
+
it 'should returns the nickname' do
|
35
|
+
expect(subject.info[:nickname]).to eq(raw_info_hash['screen_name'])
|
36
|
+
end
|
37
|
+
|
38
|
+
it 'should returns the name' do
|
39
|
+
expect(subject.info[:name]).to eq(raw_info_hash['name'])
|
40
|
+
end
|
41
|
+
|
42
|
+
it 'should returns the email' do
|
43
|
+
expect(subject.info[:email]).to eq(raw_info_hash['email'])
|
44
|
+
end
|
45
|
+
|
46
|
+
it 'should returns the location' do
|
47
|
+
expect(subject.info[:location]).to eq(raw_info_hash['location'])
|
48
|
+
end
|
49
|
+
|
50
|
+
it 'should returns the description' do
|
51
|
+
expect(subject.info[:description]).to eq(raw_info_hash['description'])
|
52
|
+
end
|
53
|
+
|
54
|
+
it 'should returns the urls' do
|
55
|
+
expect(subject.info[:urls]['Website']).to eq(raw_info_hash['url'])
|
56
|
+
expect(subject.info[:urls]['Twitter']).to eq("https://twitter.com/#{raw_info_hash['screen_name']}")
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
29
60
|
describe 'image_size option' do
|
30
61
|
context 'when user has an image' do
|
31
62
|
it 'should return image with size specified' do
|
@@ -113,3 +144,16 @@ describe OmniAuth::Strategies::Twitter do
|
|
113
144
|
end
|
114
145
|
end
|
115
146
|
end
|
147
|
+
|
148
|
+
private
|
149
|
+
|
150
|
+
def raw_info_hash
|
151
|
+
{
|
152
|
+
'screen_name' => 'foo',
|
153
|
+
'name' => 'Foo Bar',
|
154
|
+
'email' => 'foo@example.com',
|
155
|
+
'location' => 'India',
|
156
|
+
'description' => 'Developer',
|
157
|
+
'url' => 'example.com/foobar'
|
158
|
+
}
|
159
|
+
end
|
metadata
CHANGED
@@ -1,55 +1,55 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-twitter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arun Agrawal
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.3'
|
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
26
|
version: '1.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: omniauth-oauth
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '1.1'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.1'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ~>
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '1.0'
|
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
54
|
version: '1.0'
|
55
55
|
description: OmniAuth strategy for Twitter
|
@@ -59,9 +59,9 @@ executables: []
|
|
59
59
|
extensions: []
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
|
-
- .gitignore
|
63
|
-
- .rspec
|
64
|
-
- .travis.yml
|
62
|
+
- ".gitignore"
|
63
|
+
- ".rspec"
|
64
|
+
- ".travis.yml"
|
65
65
|
- CONTRIBUTING.md
|
66
66
|
- Gemfile
|
67
67
|
- README.md
|
@@ -82,17 +82,17 @@ require_paths:
|
|
82
82
|
- lib
|
83
83
|
required_ruby_version: !ruby/object:Gem::Requirement
|
84
84
|
requirements:
|
85
|
-
- -
|
85
|
+
- - ">="
|
86
86
|
- !ruby/object:Gem::Version
|
87
87
|
version: '0'
|
88
88
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
89
89
|
requirements:
|
90
|
-
- -
|
90
|
+
- - ">="
|
91
91
|
- !ruby/object:Gem::Version
|
92
92
|
version: '0'
|
93
93
|
requirements: []
|
94
94
|
rubyforge_project:
|
95
|
-
rubygems_version: 2.
|
95
|
+
rubygems_version: 2.4.5
|
96
96
|
signing_key:
|
97
97
|
specification_version: 4
|
98
98
|
summary: OmniAuth strategy for Twitter
|