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 CHANGED
@@ -74,6 +74,9 @@ Create tag v2.0.2 and build and push mixpanel_client-2.0.2.gem to Rubygems
74
74
 
75
75
  ## Changelog
76
76
 
77
+ ### v.2.2.2
78
+ * Added some more options.
79
+
77
80
  ### v.2.2.1
78
81
  * Added support for the raw data export API.
79
82
 
@@ -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, :limit, :format, :bucket,
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
@@ -10,6 +10,6 @@ module Mixpanel
10
10
  # Return metrics from Mixpanel Data API
11
11
  class Client
12
12
  # Mixpanel::Client library version
13
- VERSION = '2.2.1'
13
+ VERSION = '2.2.2'
14
14
  end
15
15
  end
@@ -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 '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
- limit 5
99
- format 'csv'
100
- bucket 'list'
101
- values '["tiger", "blood"]'
102
- timezone '-8'
103
- from_date '2011-08-11'
104
- to_date '2011-08-12'
105
- on 'properties["product_id"]'
106
- where '1 in properties["product_id"]'
107
- buckets '5'
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: 5
4
+ hash: 3
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 2
9
- - 1
10
- version: 2.2.1
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-03-04 00:00:00 Z
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.8.15
177
+ rubygems_version: 1.6.2
176
178
  signing_key:
177
179
  specification_version: 3
178
180
  summary: Ruby Mixpanel API Client Library