uber_login 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZGEwZjM1NDhmNmNiYWI5Y2NlZTMyZmMyMzlhMTg5YzE3MjdmNTFiZQ==
4
+ MGE2Y2E2MzNjYTA2ODMxZDYwNmU0MGFlNjM2MmVkNTkxOTJkMWU3Mw==
5
5
  data.tar.gz: !binary |-
6
- ZDJmNjkzZmUzZTczM2U3NzZmZjYwNTRiNDljMjljM2Y5M2YzY2FiNw==
6
+ NDAzMDg0NGU2MmMyNDBkZDY4YmNhY2ZjYWEwODUwNjBjMjY2NjhmOA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MTIyMDc4MzRmMTg1MDRkZGE0NmNiNjcyNDY1MmQ1MTEzMTk5ZTQ2YzBjYTE4
10
- Yzc4MWJkNzdiNGRhNzE4YWVhMTBlMjM3YTQ5MzQ5NzkwYTkxNTk5MjYxNGFm
11
- ZTY5OWQ4NjI0OWJmMjcxZDk0OThjZDVhMDQwMTQ4ODUzOTUwNDg=
9
+ YTZjYTBkMzRhZTIyOGFlM2M2NjA0YjE3NmFjOGU1MzdkNzcxM2Q2OTMxYmU2
10
+ NmI3NjcwMGI5ZGE0NWMxN2U0ZDA5MGY5OWQxYzQ1Y2UxMWViNDE3MGNmNWEw
11
+ ZjE5ZDM3ZTZlZTliZTUzMjc3YTljMzdhMDk2NTc4Zjk4NTVmMDQ=
12
12
  data.tar.gz: !binary |-
13
- MzU1MmQ3ODYxMWZlYWNhNDQ2MGUwZTEwYTNkYzc4YjY0M2U1MGRmNjMyMzM5
14
- ZDVkYjJhNWUxNDdkMzM2N2I3YzQ0Y2ViNzcxNjQwMzY4MDJjY2VhY2ZiNjU5
15
- ODU2M2UwNzQ5OGM1MGMwMGE5NDJhMWViOTU2MjAwMmY5MjQzMmM=
13
+ ZDNmNjI3NWUyYWJiYWJiYTNjYThiZmM1YmFjNDMwYjljMDVhMGNmMmY1MGU1
14
+ YzdjZTYyYTlmNTZjY2NjY2Q3MGU1ZmVlMTQ0MDY4MDI5YmY4OWRmZGU2NzE1
15
+ OWI5ZjZiNGRhZGY0ZWFhZTE5MzI2ZWQwZDk5MGYzYzcxYzAyZGU=
@@ -1,3 +1,3 @@
1
1
  module UberLogin
2
- VERSION = '1.0.2'
2
+ VERSION = '1.0.3'
3
3
  end
data/lib/uber_login.rb CHANGED
@@ -145,11 +145,21 @@ module UberLogin
145
145
  end
146
146
 
147
147
  def set_user_data(row)
148
- user_agent = UserAgent.parse(request.user_agent)
149
-
150
148
  row.ip_address = request.remote_ip if row.respond_to? :ip_address=
151
- row.os = (user_agent.os || '') if row.respond_to? :os=
152
- row.browser = (user_agent.browser || '') + ' ' + user_agent.version if row.respond_to? :browser=
149
+ row.os = os_string if row.respond_to? :os=
150
+ row.browser = browser_string if row.respond_to? :browser=
151
+ end
152
+
153
+ def user_agent
154
+ @user_agent ||= UserAgent.parse(request.user_agent)
155
+ end
156
+
157
+ def os_string
158
+ user_agent.os || ''
159
+ end
160
+
161
+ def browser_string
162
+ (user_agent.browser || '') + ' ' + (user_agent.version || '')
153
163
  end
154
164
 
155
165
  def strong_sessions
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uber_login
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francesco Boffa