conductor 0.5.15 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +3 -1
- data/VERSION +1 -1
- data/generators/conductor/conductor_generator.rb +27 -0
- data/generators/conductor/templates/conductor.css +0 -0
- data/generators/conductor/templates/conductor.rake +6 -0
- data/generators/{conductor_migration → conductor}/templates/migration.rb +0 -0
- data/lib/conductor.rb +2 -0
- data/lib/conductor/helpers/dashboard_helper.rb +69 -0
- data/lib/conductor/views/dashboard/index.html.haml +66 -54
- metadata +36 -8
- data/generators/conductor_migration/conductor_migration_generator.rb +0 -9
data/Rakefile
CHANGED
@@ -11,7 +11,9 @@ begin
|
|
11
11
|
gem.homepage = "http://github.com/noctivityinc/conductor"
|
12
12
|
gem.authors = ["Noctivity"]
|
13
13
|
gem.rubyforge_project = "conductor"
|
14
|
-
gem.files = FileList["[A-Z]*", "{generators,lib}/**/*", "init.rb"]
|
14
|
+
gem.files = FileList["[A-Z]*", "{generators,lib,tasks}/**/*", "init.rb"]
|
15
|
+
gem.add_dependency 'googlecharts'
|
16
|
+
gem.add_dependency 'haml'
|
15
17
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
16
18
|
end
|
17
19
|
Jeweler::GemcutterTasks.new
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.6.3
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
class ConductorGenerator < Rails::Generator::Base
|
4
|
+
|
5
|
+
def initialize(*runtime_args)
|
6
|
+
super
|
7
|
+
end
|
8
|
+
|
9
|
+
def manifest
|
10
|
+
record do |m|
|
11
|
+
m.directory File.join('lib', 'tasks')
|
12
|
+
m.template 'conductor.rake', File.join('lib', 'tasks', 'conductor.rake')
|
13
|
+
|
14
|
+
m.migration_template 'migration.rb', 'db/migrate', :migration_file_name => "conductor_migration"
|
15
|
+
|
16
|
+
m.directory File.join('public', 'stylesheets')
|
17
|
+
m.template 'conductor.css', File.join('public', 'stylesheets', 'conductor.css')
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
protected
|
22
|
+
|
23
|
+
def banner
|
24
|
+
%{Usage: #{$0} #{spec.name}\nCopies conductor.rake to lib/tasks. Copies migration file to db/migrate. Copies conductor.css to public/stylesheets/}
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
File without changes
|
File without changes
|
data/lib/conductor.rb
CHANGED
@@ -0,0 +1,69 @@
|
|
1
|
+
module DashboardHelper
|
2
|
+
def current_weights(group_name, group)
|
3
|
+
total = group.inject(0) {|res, x| res += x.weight}
|
4
|
+
data = []
|
5
|
+
legend = []
|
6
|
+
group.each do |x|
|
7
|
+
legend << "#{x.alternative} (#{"%0.2f" % (x.weight.to_f/total.to_f*100)}%)"
|
8
|
+
data << x.weight
|
9
|
+
end
|
10
|
+
return Gchart.pie(:data => data, :legend => legend, :size => '600x200')
|
11
|
+
end
|
12
|
+
|
13
|
+
def daily_stats(group_name, group)
|
14
|
+
data = []
|
15
|
+
legend = []
|
16
|
+
colors = []
|
17
|
+
group.group_by(&:alternative).map do |alternative, rows|
|
18
|
+
legend << alternative
|
19
|
+
data << rows.sort_by(&:activity_date).map(&:views)
|
20
|
+
colors << random_color
|
21
|
+
end
|
22
|
+
|
23
|
+
min_value = group.min {|a,b| a.views <=> b.views }.views
|
24
|
+
max_value = group.max {|a,b| a.views <=> b.views }.views
|
25
|
+
dr = group.min {|a,b| a.activity_date <=> b.activity_date }.activity_date..group.max {|a,b| a.activity_date <=> b.activity_date }.activity_date
|
26
|
+
|
27
|
+
return Gchart.line(:size => '600x250',
|
28
|
+
:title => group_name,
|
29
|
+
:legend => legend,
|
30
|
+
:data => data,
|
31
|
+
:axis_with_labels => ['x','y'],
|
32
|
+
:axis_labels => [dr.step(3).map {|x| x},(min_value..max_value).step(10).map {|x| x}],
|
33
|
+
:line_colors => colors)
|
34
|
+
end
|
35
|
+
|
36
|
+
def weight_history(group_name, group)
|
37
|
+
data = []
|
38
|
+
legend = []
|
39
|
+
colors = []
|
40
|
+
group.group_by(&:alternative).each do |alternative, rows|
|
41
|
+
legend << alternative
|
42
|
+
data << rows.sort_by(&:computed_at).map(&:weight)
|
43
|
+
colors << random_color
|
44
|
+
end
|
45
|
+
|
46
|
+
min_value = group.min {|a,b| a.weight <=> b.weight }.weight
|
47
|
+
max_value = group.max {|a,b| a.weight <=> b.weight }.weight
|
48
|
+
dr = group.min {|a,b| a.computed_at <=> b.computed_at}.computed_at.to_date..group.max {|a,b| a.computed_at <=> b.computed_at }.computed_at.to_date
|
49
|
+
|
50
|
+
return Gchart.line(:size => '700x350',
|
51
|
+
:title => group_name,
|
52
|
+
:legend => legend,
|
53
|
+
:data => data,
|
54
|
+
:axis_with_labels => ['x','y'],
|
55
|
+
:axis_labels => [dr.step(1).map {|x| x},(min_value..max_value).step(10).map {|x| x}],
|
56
|
+
:line_colors => colors,
|
57
|
+
:encoding => 'extended')
|
58
|
+
end
|
59
|
+
|
60
|
+
|
61
|
+
# Method to select a random color from a list of hex codes
|
62
|
+
#
|
63
|
+
# Example: random_color()
|
64
|
+
# => "ff0000"
|
65
|
+
def random_color()
|
66
|
+
color_list = %w{000000 0000ff ff0000 ffff00 00ffff ff00ff 00ff00}
|
67
|
+
return color_list[rand(color_list.size)]
|
68
|
+
end
|
69
|
+
end
|
@@ -1,58 +1,70 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
1
|
+
!!!
|
2
|
+
%html{ :xmlns => "http://www.w3.org/1999/xhtml" }
|
3
|
+
%head
|
4
|
+
%meta{ :content => "text/html; charset=utf-8", "http-equiv" => "Content-Type" }
|
5
|
+
%title
|
6
|
+
= h(yield(:title) || "Conductor Statistic as of #{Time.now}")
|
7
|
+
= stylesheet_link_tag 'conductor', :media => "all"
|
8
|
+
%body
|
9
|
+
#conductor_dashboard
|
10
|
+
#weights
|
11
|
+
%h2 Current Experiment Weights
|
12
|
+
- @weights.group_by(&:group_name).each do |group_name, group|
|
13
|
+
.group
|
14
|
+
%fieldset
|
15
|
+
%legend= group_name
|
16
|
+
= image_tag current_weights(group_name, group)
|
17
|
+
%table
|
18
|
+
%tr
|
19
|
+
%th Alternative
|
20
|
+
%th Weight
|
21
|
+
- group.each do |row|
|
22
|
+
%tr
|
23
|
+
%td.name= row.alternative
|
24
|
+
%td.weight= row.weight
|
16
25
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
%
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
26
|
+
#dailies
|
27
|
+
%h2 Experiment Statistics
|
28
|
+
- @dailies.group_by(&:group_name).each do |group_name, group|
|
29
|
+
.group
|
30
|
+
%fieldset
|
31
|
+
%legend= group_name
|
32
|
+
.chart
|
33
|
+
= image_tag daily_stats(group_name, group)
|
34
|
+
%table
|
35
|
+
%tr
|
36
|
+
%th Date
|
37
|
+
%th Alternative
|
38
|
+
%th Views
|
39
|
+
%th Conversions
|
40
|
+
%th Value
|
41
|
+
- group.sort_by(&:activity_date).reverse.each do |row|
|
42
|
+
%tr
|
43
|
+
%td.date= row.activity_date
|
44
|
+
%td.name= row.alternative
|
45
|
+
%td.views= row.views
|
46
|
+
%td.conversions= row.conversions
|
47
|
+
%td.value= row.conversion_value
|
37
48
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
49
|
+
#history
|
50
|
+
%h2 Experiment Weight History
|
51
|
+
- @weight_history.group_by(&:group_name).each do |group_name, group|
|
52
|
+
.group
|
53
|
+
%fieldset
|
54
|
+
%legend= group_name
|
55
|
+
= image_tag weight_history(group_name, group)
|
56
|
+
%table
|
57
|
+
%tr
|
58
|
+
%th Date
|
59
|
+
%th Alternative
|
60
|
+
%th Weight
|
61
|
+
- group.sort_by(&:computed_at).reverse.each do |row|
|
62
|
+
%tr
|
63
|
+
%td.date
|
64
|
+
= row.computed_at
|
65
|
+
- if row.launch_window
|
66
|
+
= "(#{row.launch_window} day(s) till hard launch)"
|
67
|
+
%td.name= row.alternative
|
68
|
+
%td.weight= row.weight
|
57
69
|
|
58
70
|
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
-
-
|
8
|
-
-
|
9
|
-
version: 0.
|
7
|
+
- 6
|
8
|
+
- 3
|
9
|
+
version: 0.6.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Noctivity
|
@@ -14,10 +14,35 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-10-01 00:00:00 -04:00
|
18
18
|
default_executable:
|
19
|
-
dependencies:
|
20
|
-
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: googlecharts
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
segments:
|
29
|
+
- 0
|
30
|
+
version: "0"
|
31
|
+
type: :runtime
|
32
|
+
version_requirements: *id001
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: haml
|
35
|
+
prerelease: false
|
36
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
37
|
+
none: false
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
segments:
|
42
|
+
- 0
|
43
|
+
version: "0"
|
44
|
+
type: :runtime
|
45
|
+
version_requirements: *id002
|
21
46
|
description: Conductor is the bastard child of a/b testing and personalization. It throws everything you know about creating a web site our the window and lets you just "try stuff" without ever having to worry about not maximing your site's "purpose." Have a new landing page? Just throw it to the conductor. Want to try different price points - conductor. Different form designs? Conductor. Conductor will rotate all alternatives through the mix and eventually settle on the top performing of all, without you having to do anything other than just creating. Think "intelligent A/B testing" on steriods.
|
22
47
|
email: jlippiner@noctivity.com
|
23
48
|
executables: []
|
@@ -32,8 +57,10 @@ files:
|
|
32
57
|
- README.rdoc
|
33
58
|
- Rakefile
|
34
59
|
- VERSION
|
35
|
-
- generators/
|
36
|
-
- generators/
|
60
|
+
- generators/conductor/conductor_generator.rb
|
61
|
+
- generators/conductor/templates/conductor.css
|
62
|
+
- generators/conductor/templates/conductor.rake
|
63
|
+
- generators/conductor/templates/migration.rb
|
37
64
|
- init.rb
|
38
65
|
- lib/conductor.rb
|
39
66
|
- lib/conductor/controller/dashboard.rb
|
@@ -42,6 +69,7 @@ files:
|
|
42
69
|
- lib/conductor/experiment/history.rb
|
43
70
|
- lib/conductor/experiment/raw.rb
|
44
71
|
- lib/conductor/experiment/weight.rb
|
72
|
+
- lib/conductor/helpers/dashboard_helper.rb
|
45
73
|
- lib/conductor/roll_up.rb
|
46
74
|
- lib/conductor/views/dashboard/index.html.haml
|
47
75
|
- lib/conductor/weights.rb
|