mixpanel-ruby 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Readme.rdoc +3 -0
- data/lib/mixpanel-ruby/consumer.rb +6 -0
- data/lib/mixpanel-ruby/version.rb +1 -1
- data/spec/mixpanel-ruby/consumer_spec.rb +13 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 286b3bfe7565a25de53140a93d879b403331b87d
|
4
|
+
data.tar.gz: b6eed03923e1eee12b21075e5afe48ac4c81807a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 765115c755470429ef8a93609b2e42578a1cfb762df1474d1e98b0eb3188c869235b2d7e7a4e1569a1aa098fc1211478285434b9e689d3186caa512c5f7b83ad
|
7
|
+
data.tar.gz: 4844747e4c68ecaca350d4c720118716014306e803eb5f414bd4a3ed11e701ea474bd7e321bc539e9ea2134186e69fe968263322ac57ff9bb99e3c99cce0be08
|
data/Readme.rdoc
CHANGED
@@ -49,6 +49,9 @@ In particular, for Rails apps, the following projects are currently actively mai
|
|
49
49
|
|
50
50
|
== Changes
|
51
51
|
|
52
|
+
== 2.0.1
|
53
|
+
* Add Deprecated version of Mixpanel::BufferedConsumer#send
|
54
|
+
|
52
55
|
== 2.0.0
|
53
56
|
* Raise mixpanel server and connection errors in Mixpanel::Consumer.
|
54
57
|
* All public methods in Mixpanel::Event, Mixpanel::People, and subsequently Mixpanel::Tracker
|
@@ -216,6 +216,12 @@ module Mixpanel
|
|
216
216
|
end
|
217
217
|
end
|
218
218
|
|
219
|
+
# This method was deprecated in release 2.0.0, please use send! instead
|
220
|
+
def send(type, message)
|
221
|
+
warn '[DEPRECATION] send has been deprecated as of release 2.0.0, please use send! instead'
|
222
|
+
send!(type, message)
|
223
|
+
end
|
224
|
+
|
219
225
|
# Pushes all remaining messages in the buffer to Mixpanel.
|
220
226
|
# You should call #flush before your application exits or
|
221
227
|
# messages may not be sent.
|
@@ -39,6 +39,13 @@ describe Mixpanel::Consumer do
|
|
39
39
|
stub_request(:any, 'https://api.mixpanel.com/track').to_return({:status => 401, :body => "nutcakes"})
|
40
40
|
expect { subject.send!(:event, {'data' => 'TEST EVENT MESSAGE'}.to_json) }.to raise_exception('Could not write to Mixpanel, server responded with 401 returning: \'nutcakes\'')
|
41
41
|
end
|
42
|
+
|
43
|
+
it 'should still respond to send' do
|
44
|
+
stub_request(:any, 'https://api.mixpanel.com/track').to_return({:body => '{"status": 1, "error": null}'})
|
45
|
+
subject.send(:event, {'data' => 'TEST EVENT MESSAGE'}.to_json)
|
46
|
+
expect(WebMock).to have_requested(:post, 'https://api.mixpanel.com/track').
|
47
|
+
with(:body => {'data' => 'IlRFU1QgRVZFTlQgTUVTU0FHRSI=', 'verbose' => '1' })
|
48
|
+
end
|
42
49
|
end
|
43
50
|
|
44
51
|
context 'raw consumer' do
|
@@ -85,6 +92,12 @@ describe Mixpanel::BufferedConsumer do
|
|
85
92
|
with(:body => {'data' => 'WyJURVNUIEVWRU5UIDEiXQ==', 'verbose' => '1' })
|
86
93
|
end
|
87
94
|
|
95
|
+
it 'should still respond to send' do
|
96
|
+
stub_request(:any, 'https://api.mixpanel.com/track').to_return({:body => '{"status": 1, "error": null}'})
|
97
|
+
subject.send(:event, {'data' => 'TEST EVENT 1'}.to_json)
|
98
|
+
expect(WebMock).to have_not_requested(:post, 'https://api.mixpanel.com/track')
|
99
|
+
end
|
100
|
+
|
88
101
|
it 'should send one message when max_length events are tracked' do
|
89
102
|
stub_request(:any, 'https://api.mixpanel.com/track').to_return({:body => '{"status": 1, "error": null}'})
|
90
103
|
|