field_test 0.6.0 → 0.7.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/LICENSE.txt +1 -1
- data/README.md +1 -1
- data/app/views/field_test/experiments/_experiments.html.erb +4 -4
- data/app/views/field_test/experiments/show.html.erb +3 -3
- data/app/views/field_test/participants/show.html.erb +13 -4
- data/app/views/layouts/field_test/application.html.erb +9 -2
- data/lib/field_test/experiment.rb +3 -3
- data/lib/field_test/version.rb +1 -1
- data/lib/field_test.rb +6 -5
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb5a6ce72e7c8ac19e10ad432f9feb6f31a8cbcc31c8f57585cca0661b0ce66a
|
4
|
+
data.tar.gz: 193c9cebdb015e685682c347ea83cccf91b9bf8ea429d74410c435dfdcaf8304
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7bc7a8c2ff54db35b0ebd5f243a150489e5cab41d0213fc0f8ac5b79aeb89bcfbddf49a9f8d64cd924d816521e01e871991d06fe5204e3ea16d178f44a93d14
|
7
|
+
data.tar.gz: b37b79f2488a5d3dbc1aeaa5a588adde06d6f5c2dcd07f4390f8db24cdae7d53d879efb4e19451512e29b47cd0a96d8562992323c99fd68135143d9df10a4c11
|
data/CHANGELOG.md
CHANGED
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
|
10
10
|
Uses [Bayesian statistics](https://www.evanmiller.org/bayesian-ab-testing.html) to evaluate results so you don’t need to choose a sample size ahead of time.
|
11
11
|
|
12
|
-
[](https://github.com/ankane/field_test/actions)
|
13
13
|
|
14
14
|
## Installation
|
15
15
|
|
@@ -20,10 +20,10 @@
|
|
20
20
|
<thead>
|
21
21
|
<tr>
|
22
22
|
<th>Variant</th>
|
23
|
-
<th
|
24
|
-
<th
|
25
|
-
<th
|
26
|
-
<th
|
23
|
+
<th class="width-20">Participants</th>
|
24
|
+
<th class="width-20">Conversions</th>
|
25
|
+
<th class="width-20">Conversion Rate</th>
|
26
|
+
<th class="width-20">Prob Winning</th>
|
27
27
|
</tr>
|
28
28
|
</thead>
|
29
29
|
<tbody>
|
@@ -14,9 +14,9 @@
|
|
14
14
|
<thead>
|
15
15
|
<tr>
|
16
16
|
<th>Participant</th>
|
17
|
-
<th
|
18
|
-
<th
|
19
|
-
<th
|
17
|
+
<th class="width-20">Variant</th>
|
18
|
+
<th class="width-20">Converted</th>
|
19
|
+
<th class="width-20">Started</th>
|
20
20
|
</tr>
|
21
21
|
</thead>
|
22
22
|
<tbody>
|
@@ -10,9 +10,9 @@
|
|
10
10
|
<thead>
|
11
11
|
<tr>
|
12
12
|
<th>Experiment</th>
|
13
|
-
<th
|
14
|
-
<th
|
15
|
-
<th
|
13
|
+
<th class="width-20">Variant</th>
|
14
|
+
<th class="width-20">Converted</th>
|
15
|
+
<th class="width-20">Started</th>
|
16
16
|
</tr>
|
17
17
|
</thead>
|
18
18
|
<tbody>
|
@@ -23,7 +23,7 @@
|
|
23
23
|
<% experiment = FieldTest::Experiment.find(membership.experiment) rescue nil %>
|
24
24
|
<% if experiment %>
|
25
25
|
<%= form_for membership do |f| %>
|
26
|
-
<%= f.select "variant", options_for_select(FieldTest::Experiment.find(membership.experiment).variants.map { |v| [v, v] }, membership.variant)
|
26
|
+
<%= f.select "variant", options_for_select(FieldTest::Experiment.find(membership.experiment).variants.map { |v| [v, v] }, membership.variant) %>
|
27
27
|
<% end %>
|
28
28
|
<% else %>
|
29
29
|
<%= membership.variant %>
|
@@ -60,3 +60,12 @@
|
|
60
60
|
<% end %>
|
61
61
|
</tbody>
|
62
62
|
</table>
|
63
|
+
|
64
|
+
<%= javascript_tag nonce: true do %>
|
65
|
+
var selects = document.querySelectorAll(".edit_membership select");
|
66
|
+
for (var i = 0; i < selects.length; i++) {
|
67
|
+
selects[i].addEventListener("change", function () {
|
68
|
+
this.form.submit();
|
69
|
+
});
|
70
|
+
}
|
71
|
+
<% end %>
|
@@ -1,8 +1,11 @@
|
|
1
|
+
<!DOCTYPE html>
|
1
2
|
<html>
|
2
3
|
<head>
|
3
4
|
<title>Field Test</title>
|
4
5
|
|
5
|
-
<
|
6
|
+
<meta charset="utf-8" />
|
7
|
+
|
8
|
+
<%= content_tag :style, nonce: request.content_security_policy_nonce_directives&.include?("style-src") ? content_security_policy_nonce : nil do %>
|
6
9
|
body {
|
7
10
|
margin: 0;
|
8
11
|
padding: 20px;
|
@@ -78,7 +81,11 @@
|
|
78
81
|
padding-left: 10px;
|
79
82
|
padding-right: 10px;
|
80
83
|
}
|
81
|
-
|
84
|
+
|
85
|
+
.width-20 {
|
86
|
+
width: 20%;
|
87
|
+
}
|
88
|
+
<% end %>
|
82
89
|
</head>
|
83
90
|
<body>
|
84
91
|
<%= yield %>
|
@@ -112,13 +112,13 @@ module FieldTest
|
|
112
112
|
|
113
113
|
participated = relation.count
|
114
114
|
|
115
|
-
adapter_name = relation.
|
115
|
+
adapter_name = relation.connection_db_config.adapter.to_s
|
116
116
|
column =
|
117
117
|
if FieldTest.legacy_participants
|
118
118
|
:participant
|
119
|
-
elsif adapter_name
|
119
|
+
elsif adapter_name.match?(/postg/i) # postgres
|
120
120
|
"(participant_type, participant_id)"
|
121
|
-
elsif adapter_name
|
121
|
+
elsif adapter_name.match?(/mysql|trilogy/i)
|
122
122
|
"COALESCE(participant_type, ''), participant_id"
|
123
123
|
else
|
124
124
|
# SQLite supports single column
|
data/lib/field_test/version.rb
CHANGED
data/lib/field_test.rb
CHANGED
@@ -58,13 +58,14 @@ module FieldTest
|
|
58
58
|
|
59
59
|
def self.events_supported?
|
60
60
|
unless defined?(@events_supported)
|
61
|
-
connection = FieldTest::Membership.connection
|
62
61
|
table_name = "field_test_events"
|
63
62
|
@events_supported =
|
64
|
-
|
65
|
-
connection.data_source_exists?
|
66
|
-
|
67
|
-
|
63
|
+
FieldTest::Membership.connection_pool.with_connection do |connection|
|
64
|
+
if connection.respond_to?(:data_source_exists?)
|
65
|
+
connection.data_source_exists?(table_name)
|
66
|
+
else
|
67
|
+
connection.table_exists?(table_name)
|
68
|
+
end
|
68
69
|
end
|
69
70
|
end
|
70
71
|
@events_supported
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: field_test
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-10-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '7'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '7'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: activerecord
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '7'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '7'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: browser
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 4.
|
61
|
+
version: 4.3.3
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 4.
|
68
|
+
version: 4.3.3
|
69
69
|
description:
|
70
70
|
email: andrew@ankane.org
|
71
71
|
executables: []
|
@@ -117,14 +117,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
117
117
|
requirements:
|
118
118
|
- - ">="
|
119
119
|
- !ruby/object:Gem::Version
|
120
|
-
version: '3'
|
120
|
+
version: '3.1'
|
121
121
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
122
122
|
requirements:
|
123
123
|
- - ">="
|
124
124
|
- !ruby/object:Gem::Version
|
125
125
|
version: '0'
|
126
126
|
requirements: []
|
127
|
-
rubygems_version: 3.
|
127
|
+
rubygems_version: 3.5.16
|
128
128
|
signing_key:
|
129
129
|
specification_version: 4
|
130
130
|
summary: A/B testing for Rails
|