meta_events 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
- ---
2
- SHA1:
3
- metadata.gz: c8e90b6eab418b987148fddd9cef0821956dc09f
4
- data.tar.gz: eba083b1ffef6f56b1775cc28ac55bd94e5c7dc9
5
- SHA512:
6
- metadata.gz: f2e1dbafa769577654782ecdfc7c1a7f8d0fb4b06a983b10677710bec4e85a79164412bcabc7af0ed77f8941588d4b9d40cdbe3c5881b3dba1f91a87bbf4e1e1
7
- data.tar.gz: 39f251715f387ad67b30c8bee7ba12e9fa8be416e95c9309cfe18b9c57446721ef06dffae1ee3de84a167cd9685d7a0bf61a9bb8cafeca16b667f477f4f47c07
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ Nzk0YTYzYzQ3ZjRhZjEwZTY2MGViNDllNzIzNzY1ZTljYjY4NzIzZg==
5
+ data.tar.gz: !binary |-
6
+ MTkyYmZjNTA4ZWUwYTQzNmE5NDE5NGQ2MjgyMDA4ODI5Y2I1MzQ2ZA==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ MzI3NjNhNjQ1NWY2ZDliNDNkODdkYWM0Yzk5OTQyZTc4NjQ3MWU3YmIxODc4
10
+ OTcwOGNlOGQ4MTJiNTRhY2ZjNjIxZjQ2ZmJhNjBkNGJkNDE2ZmUxZTQ3NTJk
11
+ M2E5ODAzZmE3ZjNjNzc2ZmUzMTkxZTgxYmRlMWNiMmI5ZTYzMmE=
12
+ data.tar.gz: !binary |-
13
+ YTM3ODBmYmQyMDNiOWI5MzI5ZjM2OGY4ZThmMjNjZmMzMmMyNDBkOTBjYWNi
14
+ YzYyNTZmNjY2MTg5ODI2YmI5M2ZkNjUxYmM3ODg1ODVjODZhNDAyM2EyZDM4
15
+ ZDg0NmQ2ZDQ5ZjM0YTAxZDA1MDNjNWNhYWY2ZWRlMzFkZTUyZWQ=
data/.travis.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  rvm:
2
- - "2.1.0"
2
+ - "2.1.1"
3
3
  - "2.0.0"
4
4
  - "1.9.3"
5
5
  - "1.8.7"
6
- - "jruby-1.7.9"
6
+ - "jruby-1.7.11"
data/CHANGES.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # `meta_events` Changelog
2
2
 
3
+ ### 1.1.1, 26 May 2014
4
+
5
+ * 1.1.0 was accidentally released with a bad dependency that prevented it from installing against anything that used
6
+ ActiveSupport >= 4.0. This corrects that error.
7
+ * Documented how to make MetaEvents work with background systems like Resque or Sidekiq to make event dispatch
8
+ asynchronous.
9
+ * Documented that the `mixpanel-ruby` gem is still required to work with Mixpanel server-side, and that the Mixpanel
10
+ JavaScript code is still required to work with Mixpanel on the front end.
11
+ * Changed Travis configuration to use Ruby 2.1.1 (vs. 2.1.0) and JRuby 1.7.11 (vs. 1.7.9).
12
+
3
13
  ## 1.1.0, 25 May 2014
4
14
 
5
15
  * Support for customizing the event names to Mixpanel using any algorithm you want (`:external_name` in `MetaEvents::Tracker#initialize` or `MetaEvents::Tracker.default_external_name`), or by overriding them on an `Event`-by-`Event` basis (`:external_name` in the DSL on an `Event`). Many thanks to [Aaron Lerch](https://github.com/aaronlerch) for the awesome code and responsiveness!
data/README.md CHANGED
@@ -52,6 +52,9 @@ use a powerful mechanism to fire front-end events in any way you want.
52
52
 
53
53
  Let's get started. We'll assume we're working in a Rails project, although MetaEvents has no dependencies on Rails or any other particular framework. We'll also assume you've installed the MetaEvents gem (ideally via your `Gemfile`).
54
54
 
55
+ **Note**: You will also need to provide whatever API your analytics system uses; for example, in the case of Mixpanel,
56
+ you must also add `gem mixpanel-ruby` to your `Gemfile`.
57
+
55
58
  ### Declaring Events
56
59
 
57
60
  First, let's declare an event that we want to fire. Create `config/meta_events.rb` (MetaEvents automatically
@@ -170,6 +173,11 @@ the use of Rails (because `MetaEvents::ControllerMethods` is intended for use wi
170
173
  `MetaEvents::Helpers` is intended for use with `ActionView`), although the techniques are generally applicable and
171
174
  easy enough to use with any framework.
172
175
 
176
+ **Note**: Again, because MetaEvents does not directly require any one user-centric analytics system, you must make sure
177
+ the JavaScript API to whatever system you're using is loaded, too. So, for example, if you're using Mixpanel, make sure
178
+ the JavaScript code Mixpanel provides you to use its API is loaded on your page _as well as_ the MetaEvents JavaScript
179
+ code.
180
+
173
181
  #### Auto-Tracking
174
182
 
175
183
  Auto-tracking is the easiest way of triggering front-end events. MetaEvents provides a Rails helper method that adds
@@ -340,7 +348,7 @@ There are a few situations where you need to take special care, however:
340
348
  way to do this, as well as using something like nginx's `ngx_http_userid_module`.
341
349
  (Note that Mixpanel has facilities to do this automatically; however, it uses cookies set on their
342
350
  domain, which means you can't read them, which limits it unacceptably — server-side code and even your own
343
- Javascript will be unable to use this ID.)
351
+ Javascript will be unable to use this ID.) If you do this, take a look at [`web_server_uid`](https://github.com/swiftype/web_server_uid), a gem that makes manipulating the resulting IDs vastly easier in Ruby.
344
352
  * **What do I do when a user logs in?** Typically, you simply want to switch completely from using their old
345
353
  (cookie-based) unique ID to using the primary key of your `users` table (or whatever you use for tracking logged-in
346
354
  users). This may seem counterintuitive, but it makes sense, particularly in broad consumer applications: until
@@ -493,6 +501,31 @@ to you.
493
501
 
494
502
  A few things before we're done:
495
503
 
504
+ ### Performance and Asynchronousness
505
+
506
+ When deploying Mixpanel or other such systems in a live application, you very often want to dispatch event reporting
507
+ in the background, so that any slowdown in Mixpanel's servers doesn't slow down your application (or, in the worst
508
+ case, bring it down entirely). Typically, this is done using something like [Resque](https://github.com/resque/resque),
509
+ [Sidekiq](http://sidekiq.org/), or another queue-based system. There are literally dozens of these systems available
510
+ for Ruby, and it's highly likely that your codebase either uses one already or will soon. Additionally, many users
511
+ layer additional features like logging, durability, or other infrastructure services on top of the base functionality
512
+ of these packages.
513
+
514
+ Because there is such a wide variety of these systems available, MetaEvents does not _directly_ provide support for
515
+ them — doing so would be a great deal of effort, and yet still unlikely to satisfy most users. Instead,
516
+ MetaEvents makes it very easy to use any package you want:
517
+
518
+ class MyEventReceiver
519
+ def track(distinct_id, event_name, event_properties)
520
+ # Call Resque, Sidekiq, or anything else you want here; enqueue a job that, when run, will call:
521
+ # Mixpanel::Tracker.new($my_mixpanel_api_key).track(distinct_id, event_name, event_properties)
522
+ end
523
+ end
524
+
525
+ MetaEvents::Tracker.default_event_receivers << MyEventReceiver.new
526
+
527
+ Voilà &mdash; asynchronous event tracking.
528
+
496
529
  ### Mixpanel, Aliasing, and People
497
530
 
498
531
  MetaEvents is _not_ intended as a complete superset of a backend analytics library (like Mixpanel) &mdash; there are
@@ -1,3 +1,3 @@
1
1
  module MetaEvents
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
metadata CHANGED
@@ -1,80 +1,98 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: meta_events
3
- version: !ruby/object:Gem::Version
4
- version: 1.1.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.1.1
5
5
  platform: ruby
6
- authors:
6
+ authors:
7
7
  - Andrew Geweke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
-
12
- date: 2014-05-25 00:00:00 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
11
+ date: 2014-05-27 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
15
14
  name: json
16
- prerelease: false
17
- requirement: &id001 !ruby/object:Gem::Requirement
18
- requirements:
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
19
17
  - - ~>
20
- - !ruby/object:Gem::Version
21
- version: "1.0"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.0'
22
20
  type: :runtime
23
- version_requirements: *id001
24
- - !ruby/object:Gem::Dependency
25
- name: activesupport
26
21
  prerelease: false
27
- requirement: &id002 !ruby/object:Gem::Requirement
28
- requirements:
29
- - - ">="
30
- - !ruby/object:Gem::Version
31
- version: "3.0"
32
- - - <
33
- - !ruby/object:Gem::Version
34
- version: "4.0"
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: activesupport
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '3.0'
34
+ - - <=
35
+ - !ruby/object:Gem::Version
36
+ version: 4.99.99
35
37
  type: :runtime
36
- version_requirements: *id002
37
- - !ruby/object:Gem::Dependency
38
- name: bundler
39
38
  prerelease: false
40
- requirement: &id003 !ruby/object:Gem::Requirement
41
- requirements:
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '3.0'
44
+ - - <=
45
+ - !ruby/object:Gem::Version
46
+ version: 4.99.99
47
+ - !ruby/object:Gem::Dependency
48
+ name: bundler
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
42
51
  - - ~>
43
- - !ruby/object:Gem::Version
44
- version: "1.5"
52
+ - !ruby/object:Gem::Version
53
+ version: '1.5'
45
54
  type: :development
46
- version_requirements: *id003
47
- - !ruby/object:Gem::Dependency
48
- name: rake
49
55
  prerelease: false
50
- requirement: &id004 !ruby/object:Gem::Requirement
51
- requirements:
52
- - &id006
53
- - ">="
54
- - !ruby/object:Gem::Version
55
- version: "0"
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ~>
59
+ - !ruby/object:Gem::Version
60
+ version: '1.5'
61
+ - !ruby/object:Gem::Dependency
62
+ name: rake
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ! '>='
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
56
68
  type: :development
57
- version_requirements: *id004
58
- - !ruby/object:Gem::Dependency
59
- name: rspec
60
69
  prerelease: false
61
- requirement: &id005 !ruby/object:Gem::Requirement
62
- requirements:
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ! '>='
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ - !ruby/object:Gem::Dependency
76
+ name: rspec
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
63
79
  - - ~>
64
- - !ruby/object:Gem::Version
65
- version: "2.14"
80
+ - !ruby/object:Gem::Version
81
+ version: '2.14'
66
82
  type: :development
67
- version_requirements: *id005
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ~>
87
+ - !ruby/object:Gem::Version
88
+ version: '2.14'
68
89
  description:
69
- email:
90
+ email:
70
91
  - ageweke@swiftype.com
71
92
  executables: []
72
-
73
93
  extensions: []
74
-
75
94
  extra_rdoc_files: []
76
-
77
- files:
95
+ files:
78
96
  - .gitignore
79
97
  - .travis.yml
80
98
  - CHANGES.md
@@ -103,29 +121,31 @@ files:
103
121
  - spec/meta_events/tracker_spec.rb
104
122
  - vendor/assets/javascripts/meta_events.js.erb
105
123
  homepage: http://www.github.com/swiftype/meta_events
106
- licenses:
124
+ licenses:
107
125
  - MIT
108
126
  metadata: {}
109
-
110
127
  post_install_message:
111
128
  rdoc_options: []
112
-
113
- require_paths:
129
+ require_paths:
114
130
  - lib
115
- required_ruby_version: !ruby/object:Gem::Requirement
116
- requirements:
117
- - *id006
118
- required_rubygems_version: !ruby/object:Gem::Requirement
119
- requirements:
120
- - *id006
131
+ required_ruby_version: !ruby/object:Gem::Requirement
132
+ requirements:
133
+ - - ! '>='
134
+ - !ruby/object:Gem::Version
135
+ version: '0'
136
+ required_rubygems_version: !ruby/object:Gem::Requirement
137
+ requirements:
138
+ - - ! '>='
139
+ - !ruby/object:Gem::Version
140
+ version: '0'
121
141
  requirements: []
122
-
123
142
  rubyforge_project:
124
- rubygems_version: 2.0.14
143
+ rubygems_version: 2.2.1
125
144
  signing_key:
126
145
  specification_version: 4
127
- summary: Structured, documented, powerful event emitting library for Mixpanel and other such systems.
128
- test_files:
146
+ summary: Structured, documented, powerful event emitting library for Mixpanel and
147
+ other such systems.
148
+ test_files:
129
149
  - spec/meta_events/controller_methods_and_helpers_spec.rb
130
150
  - spec/meta_events/definition/category_spec.rb
131
151
  - spec/meta_events/definition/definition_set_spec.rb