split 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,6 +2,7 @@ require 'rubygems'
2
2
  require 'split/experiment'
3
3
  require 'split/alternative'
4
4
  require 'split/helper'
5
+ require 'split/version'
5
6
  require 'redis/namespace'
6
7
 
7
8
  module Split
@@ -1,5 +1,6 @@
1
1
  require 'sinatra/base'
2
2
  require 'split'
3
+ require 'bigdecimal'
3
4
 
4
5
  module Split
5
6
  class Dashboard < Sinatra::Base
@@ -17,6 +18,10 @@ module Split
17
18
  def path_prefix
18
19
  request.env['SCRIPT_NAME']
19
20
  end
21
+
22
+ def number_to_percentage(number, precision = 2)
23
+ BigDecimal.new((number * 100).to_s).round(precision).to_f
24
+ end
20
25
  end
21
26
 
22
27
  get '/' do
@@ -21,7 +21,7 @@
21
21
  <td><%= alternative.participant_count %></td>
22
22
  <td><%= alternative.participant_count - alternative.completed_count %></td>
23
23
  <td><%= alternative.completed_count %></td>
24
- <td><%= (alternative.conversion_rate * 100).round(2) %>%</td>
24
+ <td><%= number_to_percentage(alternative.conversion_rate) %>%</td>
25
25
  <td><%= alternative.z_score %></td>
26
26
  <td>
27
27
  <% if experiment.winner %>
@@ -1,3 +1,3 @@
1
1
  module Split
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: split
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
4
+ hash: 25
5
+ prerelease:
5
6
  segments:
6
7
  - 0
7
8
  - 1
8
- - 0
9
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
10
11
  platform: ruby
11
12
  authors:
12
13
  - Andrew Nesbitt
@@ -14,7 +15,7 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2011-05-17 00:00:00 -04:00
18
+ date: 2011-05-18 00:00:00 -04:00
18
19
  default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
@@ -25,6 +26,7 @@ dependencies:
25
26
  requirements:
26
27
  - - ~>
27
28
  - !ruby/object:Gem::Version
29
+ hash: 1
28
30
  segments:
29
31
  - 2
30
32
  - 1
@@ -39,6 +41,7 @@ dependencies:
39
41
  requirements:
40
42
  - - ~>
41
43
  - !ruby/object:Gem::Version
44
+ hash: 55
42
45
  segments:
43
46
  - 0
44
47
  - 10
@@ -54,6 +57,7 @@ dependencies:
54
57
  requirements:
55
58
  - - ~>
56
59
  - !ruby/object:Gem::Version
60
+ hash: 19
57
61
  segments:
58
62
  - 1
59
63
  - 2
@@ -69,6 +73,7 @@ dependencies:
69
73
  requirements:
70
74
  - - ~>
71
75
  - !ruby/object:Gem::Version
76
+ hash: 15
72
77
  segments:
73
78
  - 2
74
79
  - 6
@@ -117,6 +122,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
117
122
  requirements:
118
123
  - - ">="
119
124
  - !ruby/object:Gem::Version
125
+ hash: 3
120
126
  segments:
121
127
  - 0
122
128
  version: "0"
@@ -125,13 +131,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
131
  requirements:
126
132
  - - ">="
127
133
  - !ruby/object:Gem::Version
134
+ hash: 3
128
135
  segments:
129
136
  - 0
130
137
  version: "0"
131
138
  requirements: []
132
139
 
133
140
  rubyforge_project: split
134
- rubygems_version: 1.3.7
141
+ rubygems_version: 1.6.2
135
142
  signing_key:
136
143
  specification_version: 3
137
144
  summary: Rack based split testing framework