field_test 0.6.0 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d8d4bcd81b876daa38d993863bd82e0aac6749668141e67e8eef9e801e465218
4
- data.tar.gz: a6b60a8320a65c973227d58b3e6b5de2aeaacc02a1e0e3db173c3d119bc8834b
3
+ metadata.gz: 8d9052413033d14c99cad0376c77f9ade7573485549e0852adec3fc85038a4cb
4
+ data.tar.gz: b7a9bba74ceba3b9876a75165141ffc5a9cc9537f1e2951cbddd7de57ddf16f0
5
5
  SHA512:
6
- metadata.gz: afd3fe84991c802549dc8cba3818e3ebef15ea4b0e5dcce8eff22640d8faeaeb25806434ceefeffb9c14afbba5d3b37f6d6a478fc8aab87bfc8c80ceba262c48
7
- data.tar.gz: f9d29b815fc2f6b92a1e5f6f530e04e2c03636641bac03a778669c20b29d42e6fa4095303000e33676e636736e448522108c1d2ccdfbea1e688281a3899a34c5
6
+ metadata.gz: f092659fd97859349a2673aa41be91de2a00e6d55607519d647df4caf2cf0949cf651386a11ae8072fd81c0cdc3340180b47319e2ee679b4c9c6787167591122
7
+ data.tar.gz: 9116b72afb732aeeed05f058907f7f48275e0389d27d8da98eef94815f24bdabdf75ccbe737dc062624a4d19399f9cedce6b3b184045277a147b14298bb297a1
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.6.1 (2024-09-04)
2
+
3
+ - Improved CSP support
4
+
1
5
  ## 0.6.0 (2023-07-02)
2
6
 
3
7
  - Fixed support for aliases, dates, and times in config file
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2016-2023 Andrew Kane
1
+ Copyright (c) 2016-2024 Andrew Kane
2
2
 
3
3
  MIT License
4
4
 
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
- [![Build Status](https://github.com/ankane/field_test/workflows/build/badge.svg?branch=master)](https://github.com/ankane/field_test/actions)
12
+ [![Build Status](https://github.com/ankane/field_test/actions/workflows/build.yml/badge.svg)](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 style="width: 20%;">Participants</th>
24
- <th style="width: 20%;">Conversions</th>
25
- <th style="width: 20%;">Conversion Rate</th>
26
- <th style="width: 20%;">Prob Winning</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 style="width: 20%;">Variant</th>
18
- <th style="width: 20%;">Converted</th>
19
- <th style="width: 20%;">Started</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 style="width: 20%;">Variant</th>
14
- <th style="width: 20%;">Converted</th>
15
- <th style="width: 20%;">Started</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), {}, onchange: "this.form.submit()" %>
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
- <style>
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
- </style>
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 =~ /postg/i # postgres
119
+ elsif adapter_name.match?(/postg/i) # postgres
120
120
  "(participant_type, participant_id)"
121
- elsif adapter_name =~ /mysql/i
121
+ elsif adapter_name.match?(/mysql/i)
122
122
  "COALESCE(participant_type, ''), participant_id"
123
123
  else
124
124
  # SQLite supports single column
@@ -1,3 +1,3 @@
1
1
  module FieldTest
2
- VERSION = "0.6.0"
2
+ VERSION = "0.6.1"
3
3
  end
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.6.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: 2023-07-02 00:00:00.000000000 Z
11
+ date: 2024-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -124,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
124
  - !ruby/object:Gem::Version
125
125
  version: '0'
126
126
  requirements: []
127
- rubygems_version: 3.4.10
127
+ rubygems_version: 3.5.11
128
128
  signing_key:
129
129
  specification_version: 4
130
130
  summary: A/B testing for Rails