castle-rb 1.2.10 → 1.2.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/castle-rb/client.rb +11 -1
- data/lib/castle-rb/models/label.rb +7 -0
- data/lib/castle-rb/version.rb +1 -1
- data/lib/castle-rb.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba0f2b39431a260b85e4466f76901325b5c23726
|
4
|
+
data.tar.gz: c08ad55dd0965329595500f61b309dade6be0448
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1fd3a088e41699773103700b66f76f5db17f659f0b125a7c855461f06dee6c914781bab11564724b0b3a9cfd81a92817dd71ec8210f8218046cba1bc67962c1
|
7
|
+
data.tar.gz: 24b821b597b5d660c33ae72b7e0a04419be415d8c7d15aa6c55f9d7ad5187edc5f34c1e035f36d5b8c772de5996593c20a43f04e4e770f136fdc888d53813ed6
|
data/lib/castle-rb/client.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module Castle
|
2
2
|
class Client
|
3
3
|
|
4
|
-
attr_accessor :request_context
|
4
|
+
attr_accessor :request_context, :do_not_track
|
5
5
|
|
6
6
|
def initialize(request, response, opts = {})
|
7
7
|
# Save a reference in the per-request store so that the request
|
@@ -17,13 +17,23 @@ module Castle
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def identify(user_id, opts = {})
|
20
|
+
return if @do_not_track
|
20
21
|
Castle::User.save_existing(user_id, opts)
|
21
22
|
end
|
22
23
|
|
23
24
|
def track(opts = {})
|
25
|
+
return if @do_not_track
|
24
26
|
Castle::Event.create(opts)
|
25
27
|
end
|
26
28
|
|
29
|
+
def do_not_track!
|
30
|
+
@do_not_track = true
|
31
|
+
end
|
32
|
+
|
33
|
+
def track!
|
34
|
+
@do_not_track = false
|
35
|
+
end
|
36
|
+
|
27
37
|
def authenticate(user_id)
|
28
38
|
Castle::Authentication.create(user_id: user_id)
|
29
39
|
end
|
data/lib/castle-rb/version.rb
CHANGED
data/lib/castle-rb.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: castle-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Johan Brissmyr
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: her
|
@@ -166,6 +166,7 @@ files:
|
|
166
166
|
- lib/castle-rb/models/authentication.rb
|
167
167
|
- lib/castle-rb/models/context.rb
|
168
168
|
- lib/castle-rb/models/event.rb
|
169
|
+
- lib/castle-rb/models/label.rb
|
169
170
|
- lib/castle-rb/models/location.rb
|
170
171
|
- lib/castle-rb/models/model.rb
|
171
172
|
- lib/castle-rb/models/user.rb
|