trusty 0.2.7 → 0.2.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/trusty/omniauth/provider_mapper.rb +10 -1
- data/lib/trusty/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86ddd84555ae06991f60847e5d911c4375c99ca6
|
4
|
+
data.tar.gz: 06150a7f851b1d84305c8887891920ac84cab119
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e8895a4e9dbe18c72ff5e8b6c0e8f898b2e3e284930fb0ac89aa2d559f4d63ded7afc20a42dabfc968eb6cbcf79060a211858f719094e6020e13f8a7199e265
|
7
|
+
data.tar.gz: b6112ebd29c1f00f15de57bbcf178e1faf13fdb8b544ff739cb3b907b0831d399cc78d5d2828b197c9d76d693e92cca0dd3fc15d804fb7fea95acd70106fdbd9
|
@@ -140,7 +140,7 @@ module Trusty
|
|
140
140
|
:last_name => last_name,
|
141
141
|
:phone => clean(info['phone'] || raw_info['sms_number']),
|
142
142
|
:image_url => info['image'],
|
143
|
-
:profile_url =>
|
143
|
+
:profile_url => detect_profile_url(urls) || raw_info['url'] || raw_info['blog'],
|
144
144
|
:token_type => clean(credentials['token_type']),
|
145
145
|
:token => clean(credentials['token']),
|
146
146
|
:secret => clean(credentials['secret']),
|
@@ -179,6 +179,15 @@ module Trusty
|
|
179
179
|
provider_attributes['credentials']
|
180
180
|
end
|
181
181
|
|
182
|
+
def detect_profile_url(hash)
|
183
|
+
keywords = [provider_name] + %w[profile blog company]
|
184
|
+
|
185
|
+
keywords.each do |keyword|
|
186
|
+
matched_key = hash.keys.find{ |key| key =~ /#{keyword}/i }
|
187
|
+
return hash[matched_key] if matched_key
|
188
|
+
end
|
189
|
+
end
|
190
|
+
|
182
191
|
def first_for(hash, *names)
|
183
192
|
key = names.flatten.find{ |name| hash[name] }
|
184
193
|
|
data/lib/trusty/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trusty
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joel Van Horn
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-09-
|
11
|
+
date: 2017-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -209,7 +209,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
209
209
|
version: '0'
|
210
210
|
requirements: []
|
211
211
|
rubyforge_project:
|
212
|
-
rubygems_version: 2.6.
|
212
|
+
rubygems_version: 2.6.11
|
213
213
|
signing_key:
|
214
214
|
specification_version: 4
|
215
215
|
summary: Trusty allows you to manage environment variables and other common configuration
|