trackme 0.0.4 → 0.0.21
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 +8 -8
- data/README.md +3 -6
- data/lib/trackme/event.rb +0 -3
- data/lib/trackme/version.rb +1 -1
- data/spec/app/models/event.rb +16 -1
- data/spec/lib/event_spec.rb +0 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YjkwZTMyZmE0ZGI4YWEwN2YyNDNjMDExZGEwZTA5ZmE4NGQzNmUzMg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZjIwOGI1YWRhMTY1YzRiYmM4OGUxYWQyNzY4NDYyYmUzNjQxNGI2Mg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZmU4MzlkMGNhZTYxZWYwODNmZjdjOWFlYmIwNDhlZjFmNjZmMzIwYWY5NGUx
|
10
|
+
MzdmZWYxNDM4ZGFkNGNhN2JhMmJhY2Y2OWM0MWNhMmRjNjIzMDg1ZGIzMTUx
|
11
|
+
ODAwNzM3MWY0NjMxMmIzYjVjZDc3OTEyMWI5YTFjNWFhOWE1NTY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZjI5NTA4ZDdlNWQ0MTI5ZDNiYTc2NTQ2MWQ5MzU3NGY0NmUzNWNmY2VhMTE5
|
14
|
+
MjI5MjNlMmEyNmIyYWMyODY4MDdhOWNiODg5ODVkYzk0YjQ3MTVlMmU0M2Jm
|
15
|
+
OWUzMjUyNWFhNzU0NTc5NGI4YzQ5YTY3MGY1NzA0NjdjMDFhY2I=
|
data/README.md
CHANGED
@@ -24,17 +24,14 @@ Once setup, you can track a users activity in the following way:
|
|
24
24
|
TrackMe events have the following options:
|
25
25
|
+ `:actor` (required) - The object that did the event
|
26
26
|
+ `:category` (required)- The event category, such as 'Message'
|
27
|
-
+ `:label` (
|
28
|
-
+ `:value` (
|
29
|
-
+ `:created_at` (optional)- The date the event occurred, such as '2013-09-29
|
30
|
-
12:00:00'
|
27
|
+
+ `:label` (option)- The label of the event category, such as 'New'
|
28
|
+
+ `:value` (option)- The value of the event category label, such as 'Hello Bob!'
|
31
29
|
|
32
|
-
TrackMe
|
30
|
+
TrackMe requires the following fields to save events:
|
33
31
|
+ `actor_id` - Integer
|
34
32
|
+ `category` - String
|
35
33
|
+ `label` - String
|
36
34
|
+ `value` - String
|
37
|
-
+ `created_at` - Date/Time
|
38
35
|
|
39
36
|
## Rails Example
|
40
37
|
|
data/lib/trackme/event.rb
CHANGED
data/lib/trackme/version.rb
CHANGED
data/spec/app/models/event.rb
CHANGED
@@ -6,9 +6,24 @@ class Event
|
|
6
6
|
@category = data[:category]
|
7
7
|
@label = data[:label]
|
8
8
|
@value = data[:value]
|
9
|
-
@created_at = data[:created_at]
|
10
9
|
end
|
11
10
|
|
12
11
|
def save
|
13
12
|
end
|
13
|
+
|
14
|
+
def actor
|
15
|
+
@actor
|
16
|
+
end
|
17
|
+
|
18
|
+
def category
|
19
|
+
@category
|
20
|
+
end
|
21
|
+
|
22
|
+
def label
|
23
|
+
@label
|
24
|
+
end
|
25
|
+
|
26
|
+
def value
|
27
|
+
@value
|
28
|
+
end
|
14
29
|
end
|
data/spec/lib/event_spec.rb
CHANGED
@@ -14,11 +14,6 @@ describe TrackMe do
|
|
14
14
|
event = Event.publish(user, data)
|
15
15
|
event.class.should eq(Event)
|
16
16
|
end
|
17
|
-
|
18
|
-
it "can override the create date" do
|
19
|
-
event = Event.publish(user, { created_at: Time.new(2013) }.merge(data))
|
20
|
-
event.created_at.should eq(Time.new(2013))
|
21
|
-
end
|
22
17
|
end
|
23
18
|
|
24
19
|
describe ".create" do
|