ahoy_analytics 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/models/ahoy/visit/locations.rb +6 -6
- data/lib/ahoy_analytics/version.rb +1 -1
- data/lib/ahoy_analytics.rb +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '09109fd897e9b2b406e537ccaf8ba147367b4e5e18efe9491f6290552e596449'
|
|
4
|
+
data.tar.gz: 6ca734741d9981486ddefd677a1d1023231217a3a4146d6eb4ef8cde479fa1de
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '026928617bddb7990eaf6b9c741d664cb86c0dc2bb7a7d6e62351d873d64db56bfb25a02155a560dfaa8be70fc400aeb4c120e7f4aeb8f4bb0ea1e642e42fc1b'
|
|
7
|
+
data.tar.gz: 333f6054393b61c029b04fc1692b16b158a354369f5dafb2a768806ea62cb2e15580d75db21621263c3bc11a6b061aa92491dede8730a6abb82335100c155e1d
|
|
@@ -32,7 +32,7 @@ module Ahoy::Visit::Locations
|
|
|
32
32
|
items = paged_names.map do |code|
|
|
33
33
|
code_str = code.to_s
|
|
34
34
|
name = if code_str.present? && code_str != "(unknown)"
|
|
35
|
-
c = ISO3166::Country.new(code_str.upcase)
|
|
35
|
+
c = ::ISO3166::Country.new(code_str.upcase)
|
|
36
36
|
c ? short_country_name(c) : code_str
|
|
37
37
|
else
|
|
38
38
|
"(unknown)"
|
|
@@ -56,7 +56,7 @@ module Ahoy::Visit::Locations
|
|
|
56
56
|
v = counts[code]
|
|
57
57
|
code_str = code.to_s
|
|
58
58
|
name = if code_str.present? && code_str != "(unknown)"
|
|
59
|
-
c = ISO3166::Country.new(code_str.upcase)
|
|
59
|
+
c = ::ISO3166::Country.new(code_str.upcase)
|
|
60
60
|
c ? short_country_name(c) : code_str
|
|
61
61
|
else
|
|
62
62
|
"(unknown)"
|
|
@@ -70,7 +70,7 @@ module Ahoy::Visit::Locations
|
|
|
70
70
|
items = counts.map do |code, v|
|
|
71
71
|
code_str = code.to_s
|
|
72
72
|
if code_str.present?
|
|
73
|
-
c = ISO3166::Country.new(code_str.upcase)
|
|
73
|
+
c = ::ISO3166::Country.new(code_str.upcase)
|
|
74
74
|
if c
|
|
75
75
|
{ name: short_country_name(c), code: c.alpha2, visitors: v }
|
|
76
76
|
else
|
|
@@ -211,7 +211,7 @@ module Ahoy::Visit::Locations
|
|
|
211
211
|
.filter_map do |(code, visitors)|
|
|
212
212
|
next if code.blank?
|
|
213
213
|
normalized = code.to_s.upcase
|
|
214
|
-
country = ISO3166::Country.new(normalized)
|
|
214
|
+
country = ::ISO3166::Country.new(normalized)
|
|
215
215
|
next unless country
|
|
216
216
|
{ alpha3: country.alpha3, alpha2: country.alpha2, numeric: country.number, code: normalized, name: short_country_name(country), visitors: visitors }
|
|
217
217
|
end
|
|
@@ -251,12 +251,12 @@ module Ahoy::Visit::Locations
|
|
|
251
251
|
end
|
|
252
252
|
|
|
253
253
|
def alpha3_for(code)
|
|
254
|
-
country = ISO3166::Country.new(code)
|
|
254
|
+
country = ::ISO3166::Country.new(code)
|
|
255
255
|
country&.alpha3 || code
|
|
256
256
|
end
|
|
257
257
|
|
|
258
258
|
def country_name_for(code)
|
|
259
|
-
country = ISO3166::Country.new(code)
|
|
259
|
+
country = ::ISO3166::Country.new(code)
|
|
260
260
|
country ? short_country_name(country) : code
|
|
261
261
|
end
|
|
262
262
|
|
data/lib/ahoy_analytics.rb
CHANGED