staccato-rack 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +0 -4
- data/lib/staccato/rack.rb +3 -4
- data/lib/staccato/rack/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YzQ4NDljNWM0OTk5YTQzYzI4ZWQzZjE1NzNmMzYyNDc0Mjk2ZGQwNw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MjgzM2M2MmRhZjRhOTExZDBhNmM5Y2I1ZGFmYTYzMzZkOGFkY2NmZA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZWM5M2EwMzg4ZDMyNWU4Zjk4Y2I3ODk1OTY1YTQ2NWUyN2MxY2Q2Y2RmNzI4
|
10
|
+
YzY2NzU5NTg5MGY0ZjJjYmY3MzYwOGM1Y2FiZDgzNzk5OTgzOWZlYjE5Mzlh
|
11
|
+
NzlhMGZjNzU3ZmE3MDY4OTM1OGZkNmU0NTkzNTVlOWFlZGY3OTU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YWIzMWYyZDY4OWUyNTNmNDcxODJkYWJkNzA0NjUzZmY1YTIwNGIyYjY4MzI5
|
14
|
+
YWI5YzYzY2JlYjM3Y2MwYTBiMzkwODRhNDk4NzdkZjExZGEyYjRkN2ZiMGI2
|
15
|
+
ODQyNWFiMmViMjg3ZWEyZDQwZjIxMTYwMzIzZTdiZTdiOTZmNzk=
|
data/README.md
CHANGED
@@ -1,9 +1,5 @@
|
|
1
1
|
# Staccato::Rack
|
2
2
|
|
3
|
-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/staccato/rack`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
6
|
-
|
7
3
|
## Installation
|
8
4
|
|
9
5
|
Add this line to your application's Gemfile:
|
data/lib/staccato/rack.rb
CHANGED
@@ -6,7 +6,6 @@ module Staccato
|
|
6
6
|
module Rack
|
7
7
|
# middleware
|
8
8
|
class Middleware
|
9
|
-
attr_reader :tracker
|
10
9
|
attr_accessor :last_hit
|
11
10
|
|
12
11
|
def initialize(app, tracking_id)
|
@@ -21,7 +20,7 @@ module Staccato
|
|
21
20
|
# @last_hit = nil
|
22
21
|
status, headers, body = @app.call(env)
|
23
22
|
|
24
|
-
env['staccato.pageview'].
|
23
|
+
env['staccato.tracker'].track(env['staccato.pageview'].params) if (200..299).include?(status.to_i)
|
25
24
|
|
26
25
|
# return result
|
27
26
|
[status, headers, body]
|
@@ -31,8 +30,8 @@ module Staccato
|
|
31
30
|
|
32
31
|
def load_staccato_into_env(env)
|
33
32
|
request = ::Rack::Request.new(env)
|
34
|
-
env['staccato.tracker'] = tracker
|
35
|
-
env['staccato.pageview'] = Staccato::Pageview.new(tracker,
|
33
|
+
env['staccato.tracker'] = @tracker
|
34
|
+
env['staccato.pageview'] = Staccato::Pageview.new(@tracker,
|
36
35
|
path: request.fullpath,
|
37
36
|
hostname: request.host,
|
38
37
|
user_agent: request.env['HTTP_USER_AGENT'],
|