sql_metrics 0.1.3 → 0.1.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a139785b3d57abff272c4a14aab31c7f339edb5b
4
- data.tar.gz: bc9fc962e86be934bda382fcee1e7ccc8b569c6d
3
+ metadata.gz: 9c2e9f436f2df5a9d5d6ba05022fe5acb2e7146b
4
+ data.tar.gz: f4ff424df1a7c93f5d687f2b0a290b293d70379d
5
5
  SHA512:
6
- metadata.gz: 4a8e4ed437b608dd7e57b654426bfa4d468e6afadcfefd46a0c83f3019d5b18f40395fbf62cbd3ec89d2471762959cf897e8580490cf0b073782222a6ac03ac0
7
- data.tar.gz: c671285b3820c6acd7ca91030238d18d88bf9a333de7cd9b89beb090416c0778e953e3aa3de4857f7733e6a72e54e92019251fd57626eb786addf5b5cea56f85
6
+ metadata.gz: 61d7c87bfebffbfcb1d1cbf55e8522746c6448642bbdcf107414a0b3c2b1563e39edd65c6de853821a776d5ddf327795f71425d2897026622ccd215fc7407d49
7
+ data.tar.gz: 5d464e7542fa40c65ca3206b1bca7f9a79a46ee84fd53f4f678b6aa0ccc04a9327ccf72a29e0280e8041755798f71e04618ec8af9e08a0f9d1015004398fdefc
data/.gitignore CHANGED
@@ -8,3 +8,4 @@
8
8
  /pkg/
9
9
  /spec/reports/
10
10
  /tmp/
11
+ *.gem
@@ -1,3 +1,3 @@
1
1
  module SqlMetrics
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
data/lib/sql_metrics.rb CHANGED
@@ -29,17 +29,19 @@ module SqlMetrics
29
29
  class << self
30
30
  attr_accessor :configuration
31
31
 
32
- def merge_request_into_properties(properties, request)
32
+ def merge_request_and_options_into_properties(properties, request, options)
33
33
  if request
34
34
  properties[:user_agent] = request.user_agent
35
35
  properties[:session_id] = request.session_options[:id]
36
36
  properties[:remote_ip] = request.remote_ip
37
37
 
38
- if properties[:remote_ip] and geo_object = Geocoder.search(properties[:remote_ip]).first
39
- properties[:remote_city] = geo_object.city
40
- properties[:remote_country] = geo_object.country
41
- properties[:remote_country_code] = geo_object.country_code
42
- properties[:remote_coordinates] = geo_object.coordinates
38
+ unless options and options[:reverse_ip_lookup] == false
39
+ if properties[:remote_ip] and geo_object = Geocoder.search(properties[:remote_ip]).first
40
+ properties[:remote_city] = geo_object.city
41
+ properties[:remote_country] = geo_object.country
42
+ properties[:remote_country_code] = geo_object.country_code
43
+ properties[:remote_coordinates] = geo_object.coordinates
44
+ end
43
45
  end
44
46
 
45
47
  properties[:referrer] = request.referer
@@ -80,7 +82,7 @@ module SqlMetrics
80
82
  end
81
83
 
82
84
  def self.track(name, properties = {}, request = nil, options = nil)
83
- properties = merge_request_into_properties(properties, request)
85
+ properties = merge_request_and_options_into_properties(properties, request, options)
84
86
 
85
87
  unless options and options[:filter_bots] == false
86
88
  return false if properties[:user_agent] and properties[:user_agent].match(SqlMetrics.configuration.bots_regex)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sql_metrics
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthias
@@ -114,9 +114,6 @@ files:
114
114
  - bin/setup
115
115
  - lib/sql_metrics.rb
116
116
  - lib/sql_metrics/version.rb
117
- - sql_metrics-0.1.0.gem
118
- - sql_metrics-0.1.1.gem
119
- - sql_metrics-0.1.2.gem
120
117
  - sql_metrics.gemspec
121
118
  homepage: https://github.com/KaktusLab/sql_metrics
122
119
  licenses:
Binary file
Binary file
Binary file