trusty 0.2.5 → 0.2.6
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 +12 -9
- 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: 57e1e69812a9eff269cfb035d3581c7c54b4aa85
|
4
|
+
data.tar.gz: 8e0a6b6d11ef2f74565ecd417ec5163353775bd6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fbd241c9a26ec21105da1a400da7ae367750bffc81aba9f82f18da4a34de22d0e7b57dbf89ca1eb101dacab14effeef1294973f385543852cdad81fe393315de
|
7
|
+
data.tar.gz: 8e3f8dfc7b0d7661d489a994ff3186843fb11d204934a8852558202f69b5e96652e27f5cc38cb3fe2489691f14aa5d6cbe935bfa241c48253fa757d5eee5d1d0
|
@@ -122,26 +122,29 @@ module Trusty
|
|
122
122
|
|
123
123
|
def attributes(*filter_attribute_names)
|
124
124
|
unless @attributes
|
125
|
-
|
126
|
-
|
125
|
+
raw_info = provider_attributes['extra']['raw_info'] || provider_attributes['extra']
|
126
|
+
info = provider_attributes.fetch('info', raw_info)
|
127
|
+
credentials = provider_attributes['credentials']
|
127
128
|
|
128
|
-
name
|
129
|
-
first_name
|
130
|
-
last_name
|
129
|
+
name = clean(info['name']) { [info['first_name'], info['last_name']].join(" ").strip }
|
130
|
+
first_name = clean(info['first_name']) { name.split(/\s+/, 2).first }
|
131
|
+
last_name = clean(info['last_name']) { name.split(/\s+/, 2).last }
|
132
|
+
urls = info.fetch('urls', {})
|
131
133
|
|
132
134
|
@attributes = {
|
133
135
|
:provider => provider_name,
|
134
136
|
:uid => clean(provider_attributes['uid']),
|
135
137
|
:name => name,
|
138
|
+
:company => info['company'] || raw_info['company'],
|
136
139
|
:email => clean(info['email'], :downcase, :strip),
|
137
|
-
:verified =>
|
140
|
+
:verified => !!(raw_info['verified_email'] || raw_info['verified']),
|
138
141
|
:username => clean(info['nickname']),
|
139
142
|
:first_name => first_name,
|
140
143
|
:middle_name => clean(info['middle_name']),
|
141
144
|
:last_name => last_name,
|
142
|
-
:phone => clean(info['phone']),
|
145
|
+
:phone => clean(info['phone'] || raw_info['sms_number']),
|
143
146
|
:image_url => info['image'],
|
144
|
-
:profile_url =>
|
147
|
+
:profile_url => urls['public_profile'] || urls['GitHub'] || raw_info['blog'],
|
145
148
|
:token_type => clean(credentials['token_type']),
|
146
149
|
:token => clean(credentials['token']),
|
147
150
|
:secret => clean(credentials['secret']),
|
@@ -150,7 +153,7 @@ module Trusty
|
|
150
153
|
:expires_at => (Time.at(credentials['expires_at']) rescue nil),
|
151
154
|
:raw_info => provider_attributes['extra'].except('access_token').as_json,
|
152
155
|
# extra
|
153
|
-
:location => info['location'],
|
156
|
+
:location => info['location'] || raw_info['location'],
|
154
157
|
:time_zone => info['time_zone'] || Time.zone.name,
|
155
158
|
:locale => info['locale'] || I18n.locale
|
156
159
|
}.with_indifferent_access
|
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.6
|
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-
|
11
|
+
date: 2017-08-26 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.12
|
213
213
|
signing_key:
|
214
214
|
specification_version: 4
|
215
215
|
summary: Trusty allows you to manage environment variables and other common configuration
|