mixpanel_client 2.0.1 → 2.0.2
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.
- data/README.md +19 -9
- data/lib/mixpanel/client.rb +1 -1
- data/lib/mixpanel/exceptions.rb +3 -1
- data/lib/mixpanel/utils.rb +5 -1
- data/lib/mixpanel/version.rb +1 -1
- data/spec/mixpanel_client/events_externalspec.rb +1 -1
- data/spec/mixpanel_client/mixpanel_client_spec.rb +2 -1
- data/spec/mixpanel_client/properties_externalspec.rb +1 -1
- metadata +4 -4
data/README.md
CHANGED
@@ -7,6 +7,10 @@ Ruby access to the [Mixpanel](http://mixpanel.com/) web analytics tool.
|
|
7
7
|
## Installation
|
8
8
|
|
9
9
|
gem install mixpanel_client
|
10
|
+
|
11
|
+
or if you use a Gemfile
|
12
|
+
|
13
|
+
gem 'mixpanel_client'
|
10
14
|
|
11
15
|
## Usage
|
12
16
|
|
@@ -17,15 +21,21 @@ Ruby access to the [Mixpanel](http://mixpanel.com/) web analytics tool.
|
|
17
21
|
client = Mixpanel::Client.new(config)
|
18
22
|
|
19
23
|
data = client.request do
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
24
|
+
# Available options
|
25
|
+
resource 'events/properties'
|
26
|
+
event '["test-event"]'
|
27
|
+
name 'hello'
|
28
|
+
values '["uno", "dos"]'
|
29
|
+
type 'general'
|
30
|
+
unit 'hour'
|
31
|
+
interval 24
|
32
|
+
limit 5
|
33
|
+
bucket 'contents'
|
34
|
+
from_date '2011-08-11'
|
35
|
+
to_date '2011-08-12'
|
36
|
+
on 'properties["product_id"]'
|
37
|
+
where '1 in properties["product_id"]'
|
38
|
+
buckets '5'
|
29
39
|
end
|
30
40
|
|
31
41
|
puts data.inspect
|
data/lib/mixpanel/client.rb
CHANGED
@@ -16,7 +16,7 @@ module Mixpanel
|
|
16
16
|
|
17
17
|
# Availalbe options for a Mixpanel API request
|
18
18
|
OPTIONS = [:resource, :event, :funnel, :name, :type, :unit, :interval, :limit, :format, :bucket,
|
19
|
-
:values, :from_date, :to_date, :on, :where, :buckets]
|
19
|
+
:values, :from_date, :to_date, :on, :where, :buckets, :timezone]
|
20
20
|
|
21
21
|
# Dynamically define accessor methods for each option
|
22
22
|
OPTIONS.each do |option|
|
data/lib/mixpanel/exceptions.rb
CHANGED
data/lib/mixpanel/utils.rb
CHANGED
data/lib/mixpanel/version.rb
CHANGED
@@ -87,6 +87,7 @@ describe Mixpanel::Client do
|
|
87
87
|
stub_request(:get, /^#{@uri}.*/).to_return(:body => '{"events": [], "type": "general"}')
|
88
88
|
|
89
89
|
@client.request do
|
90
|
+
# This is not a real request. It just lists all possible options.
|
90
91
|
resource 'events'
|
91
92
|
event '["test-event"]'
|
92
93
|
funnel 'down-the-rabbit-hole'
|
@@ -98,7 +99,7 @@ describe Mixpanel::Client do
|
|
98
99
|
format 'csv'
|
99
100
|
bucket 'list'
|
100
101
|
values '["tiger", "blood"]'
|
101
|
-
|
102
|
+
timezone '-8'
|
102
103
|
from_date '2011-08-11'
|
103
104
|
to_date '2011-08-12'
|
104
105
|
on 'properties["product_id"]'
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mixpanel_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 11
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 2.0.
|
9
|
+
- 2
|
10
|
+
version: 2.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Keolo Keagy
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-11-22 00:00:00 -08:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|