mixpanel-ruby 1.3.0 → 1.4.0

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.rdoc CHANGED
@@ -35,6 +35,13 @@ For more information please visit:
35
35
  * The usage demo[https://github.com/mixpanel/mixpanel-ruby/tree/master/demo]
36
36
  * The documentation[http://mixpanel.github.io/mixpanel-ruby/]
37
37
 
38
+ The official Mixpanel gem is built with simplicity and broad applicability in
39
+ mind, but there are also third party Ruby libraries that can work with the library
40
+ to provide useful features in common situations. One in particular is
41
+ MetaEvents[https://github.com/swiftype/meta_events], a third party gem
42
+ which provides support for client-side tracking in Rails applications,
43
+ super-properties-like persistent properties, and a DSL for defining your events.
44
+
38
45
  == Changes
39
46
 
40
47
  == 1.3.0
@@ -15,9 +15,6 @@ module Mixpanel
15
15
  # Ruby's default SSL does not verify the server certificate.
16
16
  # To verify a certificate, or install a proxy, pass a block
17
17
  # to Mixpanel.config_http that configures the Net::HTTP object.
18
- # Note: when using the Faraday adapter, the block will receive
19
- # the Faraday::Connection object. Please refer to the Faraday
20
- # documentation for configuration examples.
21
18
  # For example, if running in Ubuntu Linux, you can run
22
19
  #
23
20
  # Mixpanel.config_http do |http|
@@ -169,15 +169,21 @@ module Mixpanel
169
169
  update(message)
170
170
  end
171
171
 
172
- # Removes a property and its value from a profile.
172
+ # Removes properties and their values from a profile.
173
173
  #
174
174
  # tracker = Mixpanel::Tracker.new
175
+ #
176
+ # # removes a single property and its value from a profile
175
177
  # tracker.people.unset("12345", "Overdue Since")
176
178
  #
177
- def unset(distinct_id, property, ip=nil, optional_params={})
179
+ # # removes multiple properties and their values from a profile
180
+ # tracker.people.unset("12345", ["Overdue Since", "Paid Date"])
181
+ #
182
+ def unset(distinct_id, properties, ip=nil, optional_params={})
183
+ properties = [properties] unless properties.is_a?(Array)
178
184
  message = {
179
185
  '$distinct_id' => distinct_id,
180
- '$unset' => [property]
186
+ '$unset' => properties
181
187
  }.merge(optional_params)
182
188
 
183
189
  if ip
@@ -1,3 +1,3 @@
1
1
  module Mixpanel
2
- VERSION = '1.3.0'
2
+ VERSION = '1.4.0'
3
3
  end
@@ -116,6 +116,16 @@ describe Mixpanel::People do
116
116
  }]])
117
117
  end
118
118
 
119
+ it 'should send a well formed unset message with multiple properties' do
120
+ @people.unset('TEST ID', ['Albums', 'Vinyls'])
121
+ @log.should eq([[:profile_update, 'data' => {
122
+ '$token' => 'TEST TOKEN',
123
+ '$distinct_id' => 'TEST ID',
124
+ '$time' => @time_now.to_i * 1000,
125
+ '$unset' => ['Albums', 'Vinyls']
126
+ }]])
127
+ end
128
+
119
129
  it 'should send an engage/append with the right $transaction stuff' do
120
130
  @people.track_charge("TEST ID", 25.42, {
121
131
  '$time' => DateTime.new(1999,12,24,14, 02, 53),
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mixpanel-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-03-05 00:00:00.000000000 Z
12
+ date: 2014-04-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake