analytical 3.0.7 → 3.0.8
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/VERSION +1 -1
- data/analytical.gemspec +2 -2
- data/lib/analytical/modules/mixpanel.rb +3 -10
- data/spec/analytical/modules/mixpanel_spec.rb +1 -23
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.0.
|
1
|
+
3.0.8
|
data/analytical.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{analytical}
|
8
|
-
s.version = "3.0.
|
8
|
+
s.version = "3.0.8"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Joshua Krall", "Nathan Phelps", "Adam Anderson", "Kevin Menard", "Ablyamitov Ablyamit", "Kurt Werle", "Olivier Lauzon", "Daniel Doubrovkine"]
|
12
|
-
s.date = %q{2011-09-
|
12
|
+
s.date = %q{2011-09-27}
|
13
13
|
s.description = %q{Gem for managing multiple analytics services in your rails app.}
|
14
14
|
s.email = %q{josh@feefighters.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -40,17 +40,10 @@ module Analytical
|
|
40
40
|
"mpmetrics.identify('#{id}');"
|
41
41
|
end
|
42
42
|
|
43
|
-
def event(
|
44
|
-
|
45
|
-
step = data.delete(:step)
|
46
|
-
goal = data.delete(:goal)
|
47
|
-
callback = data.delete(:callback) || "function(){}"
|
48
|
-
return "/* API Error: Funnel is not set for 'mpmetrics.track_funnel(funnel:string, step:int, goal:string, properties:object, callback:function); */" if funnel.blank?
|
49
|
-
return "/* API Error: Step is not set for 'mpmetrics.track_funnel(#{funnel}, ...); */" unless step && step.to_i >= 0
|
50
|
-
return "/* API Error: Goal is not set for 'mpmetrics.track_funnel(#{funnel}, #{step}, ...); */" if goal.blank?
|
51
|
-
"mpmetrics.track_funnel('#{funnel}', '#{step}', '#{goal}', #{data.to_json}, #{callback});"
|
43
|
+
def event(name, attributes = {})
|
44
|
+
"mpmetrics.track('#{name}', #{attributes.to_json});"
|
52
45
|
end
|
53
46
|
|
54
47
|
end
|
55
48
|
end
|
56
|
-
end
|
49
|
+
end
|
@@ -33,29 +33,7 @@ describe "Analytical::Modules::Mixpanel" do
|
|
33
33
|
describe '#event' do
|
34
34
|
it 'should return a js string' do
|
35
35
|
@api = Analytical::Modules::Mixpanel.new :parent=>@parent, :js_url_key=>'abcdef'
|
36
|
-
@api.event('
|
37
|
-
end
|
38
|
-
describe 'without the proper data' do
|
39
|
-
it 'should return an error string with blank funnel' do
|
40
|
-
@api = Analytical::Modules::Mixpanel.new :parent=>@parent, :js_url_key=>'abcdef'
|
41
|
-
@api.event('', {:step=>5, :goal=>'thegoal'}).should =~ /Funnel is not set/
|
42
|
-
end
|
43
|
-
it 'should return an error string with blank step' do
|
44
|
-
@api = Analytical::Modules::Mixpanel.new :parent=>@parent, :js_url_key=>'abcdef'
|
45
|
-
@api.event('My Funnel', {:goal=>'thegoal'}).should =~ /Step is not set/
|
46
|
-
end
|
47
|
-
it 'should return an error string with step < 0' do
|
48
|
-
@api = Analytical::Modules::Mixpanel.new :parent=>@parent, :js_url_key=>'abcdef'
|
49
|
-
@api.event('My Funnel', {:step=>-1, :goal=>'thegoal'}).should =~ /Step is not set/
|
50
|
-
end
|
51
|
-
it 'should return an error string with blank goal' do
|
52
|
-
@api = Analytical::Modules::Mixpanel.new :parent=>@parent, :js_url_key=>'abcdef'
|
53
|
-
@api.event('My Funnel', {:step=>5}).should =~ /Goal is not set/
|
54
|
-
end
|
55
|
-
end
|
56
|
-
it 'should return a js string' do
|
57
|
-
@api = Analytical::Modules::Mixpanel.new :parent=>@parent, :js_url_key=>'abcdef'
|
58
|
-
@api.event('My Funnel', {:step=>5, :goal=>'thegoal', :callback=>'thecallback', :other=>'data'}).should == "mpmetrics.track_funnel('My Funnel', '5', 'thegoal', {\"other\":\"data\"}, thecallback);"
|
36
|
+
@api.event('An event happened', { :item => 43 }).should == "mpmetrics.track('An event happened', {\"item\":43});"
|
59
37
|
end
|
60
38
|
end
|
61
39
|
describe '#init_javascript' do
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: analytical
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 3.0.
|
9
|
+
- 8
|
10
|
+
version: 3.0.8
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Joshua Krall
|
@@ -22,7 +22,7 @@ autorequire:
|
|
22
22
|
bindir: bin
|
23
23
|
cert_chain: []
|
24
24
|
|
25
|
-
date: 2011-09-
|
25
|
+
date: 2011-09-27 00:00:00 -05:00
|
26
26
|
default_executable:
|
27
27
|
dependencies:
|
28
28
|
- !ruby/object:Gem::Dependency
|