woopra_track 0.1.1 → 0.1.2

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: f086eb67b919daf6479b17a3681ace3acde785d9
4
- data.tar.gz: e842a3d273e3a99e2d10117149f4a4a0212d26af
3
+ metadata.gz: d0ec5bbcdfb259b824ad0450c7215c9449331b8a
4
+ data.tar.gz: f1bcdd1c44d0d42fd15c6416caaa48cffa69ccad
5
5
  SHA512:
6
- metadata.gz: b5ad5ce7ed87604e4da354f683d200da0989c99fd011fa44efee45e3bb48ae71864d61f365b801a9a84e26e91d3313261d5152be16a4f068b17052acde8d1fca
7
- data.tar.gz: 588c1a8d06f2987c99e51eb2fb400c7d67df369593798129e8b2f8e96e6a2aa4eb6947ff9d4a4aa9fbb532278cbd3b20ac2e91f2064498604c7aad8eed1ad1d9
6
+ metadata.gz: 76db189c30fabc451bfbd37154576b88eefca920665abb23f95b85483cd7a37d217ca5b230e67aabb2244f3f3d974640c0d3a4c872d600b059c3dbcfdeb276b1
7
+ data.tar.gz: 8583505c7b2891ddc8adbe6a3ea244cd18965a961dadc400b383f69411d6d06868659aa24526e62a85b1db9525a11b2447ca66171558c3f8ea090eb54013fe0b
data/README.md CHANGED
@@ -143,7 +143,7 @@ and add the code in your template's header (here `home.html.erb`)
143
143
  </html>
144
144
  ```
145
145
 
146
- Finally, if you wish to track your users only through the back-end, you should set the cookie on your user's browser. However, if you are planning to also use front-end tracking, don't even bother with that step, the JavaScript tracker will handle it for you.
146
+ If you wish to track your users only through the back-end, you should set the cookie on your user's browser. However, if you are planning to also use front-end tracking, don't even bother with that step, the JavaScript tracker will handle it for you.
147
147
 
148
148
  ``` ruby
149
149
  # During initialization
@@ -154,6 +154,12 @@ woopra(request, config, cookies)
154
154
  @woopra.set_cookie(cookies)
155
155
  ```
156
156
 
157
+ Finally, if you want to enable logging for back-end tracking requests, just call `enable_logging`:
158
+
159
+ ``` ruby
160
+ @woopra.enable_logging
161
+ ```
162
+
157
163
  ## Development
158
164
 
159
165
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -141,18 +141,18 @@ module WoopraTrack
141
141
  request_headers = { 'User-Agent' => @request.env['HTTP_USER_AGENT'] }
142
142
  request_response = Typhoeus.get(request_url, headers: request_headers)
143
143
 
144
- log_request(request_response) if @logger
144
+ log_request(request_response, request_url) if @logger
145
145
  end
146
146
 
147
- def log_request(response)
147
+ def log_request(response, url)
148
148
  if response.success?
149
- @logger.info("Woopra") { "Success: #{request_url}" }
149
+ @logger.info("Woopra") { "Success: #{url}" }
150
150
  elsif response.timed_out?
151
- @logger.warn("Woopra") { "Timeout: #{request_url}" }
151
+ @logger.warn("Woopra") { "Timeout: #{url}" }
152
152
  elsif response.code == 0
153
- @logger.error("Woopra") { "#{response.return_message}, #{request_url}" }
153
+ @logger.error("Woopra") { "#{response.return_message}, #{url}" }
154
154
  else
155
- @logger.error("Woopra") { "WOOPRA Failed: #{response.code}, #{request_url}" }
155
+ @logger.error("Woopra") { "WOOPRA Failed: #{response.code}, #{url}" }
156
156
  end
157
157
  end
158
158
 
@@ -1,3 +1,3 @@
1
1
  module WoopraTrack
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: woopra_track
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonian Guveli
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-09-12 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