mix_tape 0.0.5 → 0.0.6

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.
@@ -23,7 +23,10 @@ module MixTape
23
23
  end
24
24
 
25
25
  MixTape.define_singleton_method("set_#{name}") do |id, *args|
26
- MixTape.client.people.set id, yield(*args)
26
+ args = yield(*args)
27
+ ip = args['$ip'] || args[:$ip] || args[:ip]
28
+
29
+ MixTape.client.people.set id, args, ip
27
30
  end
28
31
  end
29
32
 
@@ -22,8 +22,8 @@ module MixTape
22
22
  @console_logging = console_logging
23
23
  end
24
24
 
25
- def set(name, args={})
26
- puts "FakeTracker.set #{name}, #{args}" if console_logging
25
+ def set(name, args={}, ip=nil)
26
+ puts "FakeTracker.set #{name}, #{args}, #{ip}" if console_logging
27
27
  end
28
28
  end
29
29
  end
@@ -1,3 +1,3 @@
1
1
  module MixTape
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -7,7 +7,8 @@ MixTape::Builder.definition do
7
7
  user_name: user.username,
8
8
  distinct_id: user.id,
9
9
  button_id: button.id,
10
- button_page: button.page
10
+ button_page: button.page,
11
+ ip: '127.0.0.1'
11
12
  }
12
13
  end
13
14
 
@@ -30,16 +31,16 @@ describe "Triggering Events" do
30
31
  end
31
32
 
32
33
  it "tracks" do
33
- expected_properties = { user_name: "Zeus", button_id: "2", button_page: "homepage" }
34
+ expected_properties = { user_name: "Zeus", button_id: "2", button_page: "homepage", ip: '127.0.0.1' }
34
35
 
35
36
  client.should_receive(:track).with("1", "button_click", expected_properties)
36
37
  MixTape.track_button_click(user, button)
37
38
  end
38
39
 
39
40
  it "sets" do
40
- expected_properties = { user_name: "Zeus", distinct_id: "1", button_id: "2", button_page: "homepage" }
41
+ expected_properties = { user_name: "Zeus", distinct_id: "1", button_id: "2", button_page: "homepage", ip: '127.0.0.1' }
41
42
 
42
- client.people.should_receive(:set).with("1", expected_properties)
43
+ client.people.should_receive(:set).with("1", expected_properties, '127.0.0.1')
43
44
  MixTape.set_button_click(user.id, user, button)
44
45
  end
45
46
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mix_tape
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
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-10-07 00:00:00.000000000 Z
12
+ date: 2013-12-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler