scientist 1.6.2 → 1.6.3
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/lib/scientist/experiment.rb +9 -16
- data/lib/scientist/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 53663e0ed4b522336c69b73073aa144a4b6c8178e3fcd716c0e4519a66e308ba
|
4
|
+
data.tar.gz: b60d0c55dce9e1e9a23eb7e6ce4c445bf01340dcfd459d50716d7cd85e405b93
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e1baf64882c857abdd3fd02b77785a783a8694854358c78a9da3be213b42ac88e36805ebf7f10f0d87fb14d7808302e1afffd2793c5ffc21addec5326e5f969
|
7
|
+
data.tar.gz: e5a65140ca8704c7443f88404cfb9e971f4a2925d756eed18d7482be74aab3243315fda727dfe8fed13d0732d76ca442a12cb7af200ca6ae3e4de4b0f1bab1a2
|
data/lib/scientist/experiment.rb
CHANGED
@@ -84,7 +84,6 @@ module Scientist::Experiment
|
|
84
84
|
#
|
85
85
|
# Returns the configured block.
|
86
86
|
def before_run(&block)
|
87
|
-
marshalize(block)
|
88
87
|
@_scientist_before_run = block
|
89
88
|
end
|
90
89
|
|
@@ -100,7 +99,6 @@ module Scientist::Experiment
|
|
100
99
|
#
|
101
100
|
# Returns the configured block.
|
102
101
|
def clean(&block)
|
103
|
-
marshalize(block)
|
104
102
|
@_scientist_cleaner = block
|
105
103
|
end
|
106
104
|
|
@@ -133,7 +131,6 @@ module Scientist::Experiment
|
|
133
131
|
#
|
134
132
|
# Returns the block.
|
135
133
|
def compare(*args, &block)
|
136
|
-
marshalize(block)
|
137
134
|
@_scientist_comparator = block
|
138
135
|
end
|
139
136
|
|
@@ -144,7 +141,6 @@ module Scientist::Experiment
|
|
144
141
|
#
|
145
142
|
# Returns the block.
|
146
143
|
def compare_errors(*args, &block)
|
147
|
-
marshalize(block)
|
148
144
|
@_scientist_error_comparator = block
|
149
145
|
end
|
150
146
|
|
@@ -163,7 +159,6 @@ module Scientist::Experiment
|
|
163
159
|
#
|
164
160
|
# This can be called more than once with different blocks to use.
|
165
161
|
def ignore(&block)
|
166
|
-
marshalize(block)
|
167
162
|
@_scientist_ignores ||= []
|
168
163
|
@_scientist_ignores << block
|
169
164
|
end
|
@@ -256,7 +251,6 @@ module Scientist::Experiment
|
|
256
251
|
|
257
252
|
# Define a block that determines whether or not the experiment should run.
|
258
253
|
def run_if(&block)
|
259
|
-
marshalize(block)
|
260
254
|
@_scientist_run_if_block = block
|
261
255
|
end
|
262
256
|
|
@@ -282,7 +276,6 @@ module Scientist::Experiment
|
|
282
276
|
|
283
277
|
# Register a named behavior for this experiment, default "candidate".
|
284
278
|
def try(name = nil, &block)
|
285
|
-
marshalize(block)
|
286
279
|
name = (name || "candidate").to_s
|
287
280
|
|
288
281
|
if behaviors.include?(name)
|
@@ -294,7 +287,6 @@ module Scientist::Experiment
|
|
294
287
|
|
295
288
|
# Register the control behavior for this experiment.
|
296
289
|
def use(&block)
|
297
|
-
marshalize(block)
|
298
290
|
try "control", &block
|
299
291
|
end
|
300
292
|
|
@@ -332,13 +324,14 @@ module Scientist::Experiment
|
|
332
324
|
# In order to support marshaling, we have to make the procs marshalable. Some
|
333
325
|
# CI providers attempt to marshal Scientist mismatch errors so that they can
|
334
326
|
# be sent out to different places (logs, etc.) The mismatch errors contain
|
335
|
-
# code from the experiment. This code contains
|
336
|
-
# marshaled
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
327
|
+
# code from the experiment. This code contains procs. These procs prevent the
|
328
|
+
# error from being marshaled. To fix this, we simple exclude the procs from
|
329
|
+
# the data that we marshal.
|
330
|
+
def marshal_dump
|
331
|
+
[@name, @result, @raise_on_mismatches]
|
332
|
+
end
|
333
|
+
|
334
|
+
def marshal_load
|
335
|
+
@name, @result, @raise_on_mismatches = array
|
343
336
|
end
|
344
337
|
end
|
data/lib/scientist/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scientist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GitHub Open Source
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2021-
|
15
|
+
date: 2021-12-09 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: minitest
|
@@ -95,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
requirements: []
|
98
|
-
rubygems_version: 3.2.
|
98
|
+
rubygems_version: 3.2.32
|
99
99
|
signing_key:
|
100
100
|
specification_version: 4
|
101
101
|
summary: Carefully test, measure, and track refactored code.
|