kilroy 0.0.0 → 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kilroy.rb +3 -1
- data/lib/kilroy/middleware/visitor.rb +15 -0
- data/lib/kilroy/railtie.rb +7 -0
- data/lib/kilroy/version.rb +1 -1
- data/spec/kilroy_spec.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 313ee563b7a15bbc83337607f21ffe55e4593ba3b35f5c862e8057d03bec1e15
|
4
|
+
data.tar.gz: 71bc5449f214371de5272ef23b36ec20703b681f93687d59817ed6115052688e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05e3afde7bd5721105f963fb2deacbbd64cda2c38791fe2a1e4b8f8b27839e9d334eaa1abad00bf088c718793d007ec38e187d39b9a7fa88f012fa8f01fcbd3c
|
7
|
+
data.tar.gz: fdd98e9c4ba6e13c78bf85a02ee5ad0e3792c39426dd2091f03bcc712e877bbb8bfed806507c7ac9f7646785abcfaa1af9c1e8f291adb08e14a8820f003f3398
|
data/lib/kilroy.rb
CHANGED
@@ -0,0 +1,15 @@
|
|
1
|
+
module Kilroy
|
2
|
+
module Middleware
|
3
|
+
class Visitor
|
4
|
+
def initialize(app)
|
5
|
+
@app = app
|
6
|
+
end
|
7
|
+
|
8
|
+
def call(env)
|
9
|
+
request = ActionDispatch::Request.new(env)
|
10
|
+
request.cookie_jar.signed[:visitor_id] ||= SecureRandom.uuid
|
11
|
+
@app.call(env)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
data/lib/kilroy/version.rb
CHANGED
data/spec/kilroy_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kilroy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- smudge
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-10-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -62,6 +62,8 @@ files:
|
|
62
62
|
- README.md
|
63
63
|
- Rakefile
|
64
64
|
- lib/kilroy.rb
|
65
|
+
- lib/kilroy/middleware/visitor.rb
|
66
|
+
- lib/kilroy/railtie.rb
|
65
67
|
- lib/kilroy/version.rb
|
66
68
|
- spec/kilroy_spec.rb
|
67
69
|
- spec/spec_helper.rb
|