staccato-rack 0.1.0 → 0.1.1

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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- Y2IzMzI5ZDdhMWYxN2IxMWNjMTY2NDUzOWEyNDRlNDkzZDE1MDMxMg==
4
+ YzQ4NDljNWM0OTk5YTQzYzI4ZWQzZjE1NzNmMzYyNDc0Mjk2ZGQwNw==
5
5
  data.tar.gz: !binary |-
6
- OGQ3ZmZmMjUzYWNlMzg3MmVhMGI3YjAyNTVmYTQxOWZjN2Q5YzE3ZA==
6
+ MjgzM2M2MmRhZjRhOTExZDBhNmM5Y2I1ZGFmYTYzMzZkOGFkY2NmZA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- N2JlNGQ2N2JjMjAyOTM4ZjRmZjg2MGFlOGZhNDQ0YmFhYTI3OWViODkzMmZj
10
- YmIxMGEyMGJhNzQwMzU5YWFiYWQ5NDM5OWI1MmI4YmU4ZmI4ODVlYmYxNzZi
11
- MjY4NjA5MjI2NmVhMTUxMDA0ZGI4NzZhZDVkYmE4MTkyNmQ0NjM=
9
+ ZWM5M2EwMzg4ZDMyNWU4Zjk4Y2I3ODk1OTY1YTQ2NWUyN2MxY2Q2Y2RmNzI4
10
+ YzY2NzU5NTg5MGY0ZjJjYmY3MzYwOGM1Y2FiZDgzNzk5OTgzOWZlYjE5Mzlh
11
+ NzlhMGZjNzU3ZmE3MDY4OTM1OGZkNmU0NTkzNTVlOWFlZGY3OTU=
12
12
  data.tar.gz: !binary |-
13
- OTc0NjUzZmQxZTU2MTFjYTY1N2YwZjI3YmE3ZjRmN2M2Y2M2OTcwNWY5Zjhj
14
- MjU5NzFhZjFlNmZhOWQxMWEzYjJhMDZlMzAzMTc1NjA3Yjk3ZTk5NjFiMzk4
15
- NzhlYTg3MjA2Njg0NjMwNWUyYTFhYWVjZGI2NTk2ZjUzMzY2NDQ=
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:
@@ -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'].track! if (200..299).include?(status.to_i)
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'],
@@ -2,6 +2,6 @@
2
2
  module Staccato
3
3
  # rack module
4
4
  module Rack
5
- VERSION = '0.1.0'
5
+ VERSION = '0.1.1'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: staccato-rack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grant Speelman