field_test 0.5.5 → 0.6.1
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 +2 -2
- data/lib/field_test/version.rb +1 -1
- data/lib/field_test.rb +6 -6
- 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: 8d9052413033d14c99cad0376c77f9ade7573485549e0852adec3fc85038a4cb
|
4
|
+
data.tar.gz: b7a9bba74ceba3b9876a75165141ffc5a9cc9537f1e2951cbddd7de57ddf16f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f092659fd97859349a2673aa41be91de2a00e6d55607519d647df4caf2cf0949cf651386a11ae8072fd81c0cdc3340180b47319e2ee679b4c9c6787167591122
|
7
|
+
data.tar.gz: 9116b72afb732aeeed05f058907f7f48275e0389d27d8da98eef94815f24bdabdf75ccbe737dc062624a4d19399f9cedce6b3b184045277a147b14298bb297a1
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
## 0.6.1 (2024-09-04)
|
2
|
+
|
3
|
+
- Improved CSP support
|
4
|
+
|
5
|
+
## 0.6.0 (2023-07-02)
|
6
|
+
|
7
|
+
- Fixed support for aliases, dates, and times in config file
|
8
|
+
- Dropped support for Ruby < 3 and Rails < 6.1
|
9
|
+
|
1
10
|
## 0.5.5 (2023-01-29)
|
2
11
|
|
3
12
|
- Added warning for non-string variants
|
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 %>
|
@@ -116,9 +116,9 @@ module FieldTest
|
|
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/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
@@ -7,13 +7,13 @@ require "ipaddr"
|
|
7
7
|
require "field_test/ext"
|
8
8
|
|
9
9
|
# modules
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
require_relative "field_test/experiment"
|
11
|
+
require_relative "field_test/helpers"
|
12
|
+
require_relative "field_test/participant"
|
13
|
+
require_relative "field_test/version"
|
14
14
|
|
15
15
|
# integrations
|
16
|
-
|
16
|
+
require_relative "field_test/engine" if defined?(Rails)
|
17
17
|
|
18
18
|
module FieldTest
|
19
19
|
class Error < StandardError; end
|
@@ -29,7 +29,7 @@ module FieldTest
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def self.config
|
32
|
-
@config ||= YAML.
|
32
|
+
@config ||= YAML.safe_load(ERB.new(File.read(config_path)).result, permitted_classes: [Date, Time], aliases: true)
|
33
33
|
end
|
34
34
|
|
35
35
|
def self.excluded_ips
|
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.6.1
|
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-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -16,42 +16,42 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '6.1'
|
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: '6.1'
|
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: '6.1'
|
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: '6.1'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: browser
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '2
|
47
|
+
version: '2'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '2
|
54
|
+
version: '2'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rice
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -117,14 +117,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
117
117
|
requirements:
|
118
118
|
- - ">="
|
119
119
|
- !ruby/object:Gem::Version
|
120
|
-
version: '
|
120
|
+
version: '3'
|
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.11
|
128
128
|
signing_key:
|
129
129
|
specification_version: 4
|
130
130
|
summary: A/B testing for Rails
|