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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c138b9fca14a52e0c321c4704aea6f7391766662
4
- data.tar.gz: 5757a65d2ca71592cfaa24cd5c683133c77b3be6
3
+ metadata.gz: 86ddd84555ae06991f60847e5d911c4375c99ca6
4
+ data.tar.gz: 06150a7f851b1d84305c8887891920ac84cab119
5
5
  SHA512:
6
- metadata.gz: f5bf1bceee74c2fffeb430902453acb09805ca3e12d54e69f5a451f8ed288fd0fc84ed262bc211f67a791d35d520516fa1f42928d4da521e5bf4cec1e76ef1bb
7
- data.tar.gz: fd5462f1db6d72d9f4bcb643145fb0f71ca30271002d0b43f2cc69c3e0f1dfdefd1fd14177b15ebf6684388439762c47bf29b82d3ba4046afdcbf54362f99b13
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 => first_for(urls, %w{profile public_profile GitHub}) || first_for(raw_info, %w{url blog}),
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
 
@@ -1,3 +1,3 @@
1
1
  module Trusty
2
- VERSION = "0.2.7"
2
+ VERSION = "0.2.8"
3
3
  end
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.7
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-10 00:00:00.000000000 Z
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.12
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