mixpanel-ruby 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Readme.rdoc +9 -1
- data/lib/mixpanel-ruby/consumer.rb +2 -1
- data/lib/mixpanel-ruby/people.rb +1 -1
- data/lib/mixpanel-ruby/version.rb +1 -1
- data/spec/mixpanel-ruby/consumer_spec.rb +7 -0
- metadata +2 -2
data/Readme.rdoc
CHANGED
@@ -38,7 +38,15 @@ For more information please visit:
|
|
38
38
|
|
39
39
|
== Changes
|
40
40
|
|
41
|
-
=== 1.0.
|
41
|
+
=== 1.0.1
|
42
|
+
* Compatibility with earlier versions of ruby. Library development will continue
|
43
|
+
to target 1.9, so later versions may not be compatible with Ruby 1.8, but we
|
44
|
+
love patches!
|
45
|
+
|
46
|
+
=== 1.0.0
|
42
47
|
* tracker#import added
|
43
48
|
* Change to internal tracking message format. Messages written
|
44
49
|
by earlier versions of the library will not work with 1.0.0 consumer classes.
|
50
|
+
* alias bugfixed
|
51
|
+
* Fixes to tests to allow for different timezones
|
52
|
+
* Support for optional/experimental people api properties in people calls
|
@@ -78,7 +78,8 @@ module Mixpanel
|
|
78
78
|
|
79
79
|
decoded_message = JSON.load(message)
|
80
80
|
api_key = decoded_message["api_key"]
|
81
|
-
data = Base64.
|
81
|
+
data = Base64.encode64(decoded_message["data"].to_json).gsub("\n", '')
|
82
|
+
|
82
83
|
uri = URI(endpoint)
|
83
84
|
|
84
85
|
client = Net::HTTP.new(uri.host, uri.port)
|
data/lib/mixpanel-ruby/people.rb
CHANGED
@@ -29,6 +29,13 @@ describe Mixpanel::Consumer do
|
|
29
29
|
WebMock.should have_requested(:post, 'https://api.mixpanel.com/import').
|
30
30
|
with(:body => {'data' => 'IlRFU1QgRVZFTlQgTUVTU0FHRSI=', 'api_key' => 'API_KEY' })
|
31
31
|
end
|
32
|
+
|
33
|
+
it 'should encode long messages without newlines' do
|
34
|
+
stub_request(:any, 'https://api.mixpanel.com/track').to_return({ :body => "1" })
|
35
|
+
@consumer.send(:event, { 'data' => 'BASE64-ENCODED VERSION OF BIN. THIS METHOD COMPLIES WITH RFC 2045. LINE FEEDS ARE ADDED TO EVERY 60 ENCODED CHARACTORS. IN RUBY 1.8 WE NEED TO JUST CALL ENCODE64 AND REMOVE THE LINE FEEDS, IN RUBY 1.9 WE CALL STRIC_ENCODED64 METHOD INSTEAD' }.to_json)
|
36
|
+
WebMock.should have_requested(:post, 'https://api.mixpanel.com/track').
|
37
|
+
with(:body => { 'data' => 'IkJBU0U2NC1FTkNPREVEIFZFUlNJT04gT0YgQklOLiBUSElTIE1FVEhPRCBDT01QTElFUyBXSVRIIFJGQyAyMDQ1LiBMSU5FIEZFRURTIEFSRSBBRERFRCBUTyBFVkVSWSA2MCBFTkNPREVEIENIQVJBQ1RPUlMuIElOIFJVQlkgMS44IFdFIE5FRUQgVE8gSlVTVCBDQUxMIEVOQ09ERTY0IEFORCBSRU1PVkUgVEhFIExJTkUgRkVFRFMsIElOIFJVQlkgMS45IFdFIENBTEwgU1RSSUNfRU5DT0RFRDY0IE1FVEhPRCBJTlNURUFEIg==' })
|
38
|
+
end
|
32
39
|
end
|
33
40
|
|
34
41
|
describe Mixpanel::BufferedConsumer do
|
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.0.
|
4
|
+
version: 1.0.1
|
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: 2013-
|
12
|
+
date: 2013-09-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|