mixpanel_client 2.2.1 → 2.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +3 -0
- data/lib/mixpanel/client.rb +4 -3
- data/lib/mixpanel/version.rb +1 -1
- data/spec/mixpanel_client/mixpanel_client_spec.rb +22 -18
- metadata +7 -5
data/README.md
CHANGED
data/lib/mixpanel/client.rb
CHANGED
@@ -16,8 +16,9 @@ module Mixpanel
|
|
16
16
|
attr_accessor :api_key, :api_secret
|
17
17
|
|
18
18
|
# Available options for a Mixpanel API request
|
19
|
-
OPTIONS = [:resource, :event, :funnel_id, :name, :type, :unit, :interval, :
|
20
|
-
:values, :from_date, :to_date, :on, :where, :buckets, :timezone
|
19
|
+
OPTIONS = [:resource, :event, :events, :funnel_id, :name, :type, :unit, :interval, :length, :limit,
|
20
|
+
:format, :bucket, :values, :from_date, :to_date, :on, :where, :buckets, :timezone,
|
21
|
+
:retention_type, :interval_count]
|
21
22
|
|
22
23
|
# Dynamically define accessor methods for each option
|
23
24
|
OPTIONS.each do |option|
|
@@ -96,7 +97,7 @@ module Mixpanel
|
|
96
97
|
:expire => Time.now.to_i + 600 # Grant this request 10 minutes
|
97
98
|
).merge!(:sig => Utils.generate_signature(params, @api_secret))
|
98
99
|
end
|
99
|
-
|
100
|
+
|
100
101
|
def self.base_uri_for_resource(resource)
|
101
102
|
resource == 'export' ? DATA_URI : BASE_URI
|
102
103
|
end
|
data/lib/mixpanel/version.rb
CHANGED
@@ -88,27 +88,31 @@ describe Mixpanel::Client do
|
|
88
88
|
|
89
89
|
@client.request do
|
90
90
|
# This is not a real request. It just lists all possible options.
|
91
|
-
resource
|
92
|
-
event
|
93
|
-
funnel_id
|
94
|
-
name
|
95
|
-
type
|
96
|
-
unit
|
97
|
-
interval
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
91
|
+
resource 'events'
|
92
|
+
event '["test-event"]'
|
93
|
+
funnel_id 'down-the-rabbit-hole'
|
94
|
+
name 'ricky-bobby'
|
95
|
+
type 'A'
|
96
|
+
unit 'hour'
|
97
|
+
interval 24
|
98
|
+
length 1
|
99
|
+
limit 5
|
100
|
+
format 'csv'
|
101
|
+
bucket 'list'
|
102
|
+
values '["tiger", "blood"]'
|
103
|
+
timezone '-8'
|
104
|
+
from_date '2011-08-11'
|
105
|
+
to_date '2011-08-12'
|
106
|
+
on 'properties["product_id"]'
|
107
|
+
where '1 in properties["product_id"]'
|
108
|
+
buckets '5'
|
109
|
+
events [{"event" => "page:view"}, {"event" => "button:click"}].to_json
|
110
|
+
retention_type 'abc'
|
111
|
+
interval_count 'def'
|
108
112
|
end
|
109
113
|
|
110
114
|
Mixpanel::Client::OPTIONS.each do |option|
|
111
|
-
@client.send(option).should_not be_nil
|
115
|
+
@client.send(option).should_not be_nil, "#{option} option was nil"
|
112
116
|
end
|
113
117
|
|
114
118
|
@client.request do
|
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: 3
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 2.2.
|
9
|
+
- 2
|
10
|
+
version: 2.2.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Keolo Keagy
|
@@ -15,7 +15,8 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-
|
18
|
+
date: 2012-07-22 00:00:00 -07:00
|
19
|
+
default_executable:
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
21
22
|
name: json
|
@@ -143,6 +144,7 @@ files:
|
|
143
144
|
- spec/mixpanel_client/properties_externalspec.rb
|
144
145
|
- spec/mixpanel_client/uri_spec.rb
|
145
146
|
- spec/spec_helper.rb
|
147
|
+
has_rdoc: true
|
146
148
|
homepage: http://github.com/keolo/mixpanel_client
|
147
149
|
licenses: []
|
148
150
|
|
@@ -172,7 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
172
174
|
requirements: []
|
173
175
|
|
174
176
|
rubyforge_project: mixpanel_client
|
175
|
-
rubygems_version: 1.
|
177
|
+
rubygems_version: 1.6.2
|
176
178
|
signing_key:
|
177
179
|
specification_version: 3
|
178
180
|
summary: Ruby Mixpanel API Client Library
|