scientist 1.6.2 → 1.6.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1e623b9acbede185a6ee8ca0ae2227a52707499c28bdf04e4fe8a2afcbd0f051
4
- data.tar.gz: 560b1d3353829f6be217229546297fcd4102e6c47dc87fc12ffa963c5e2fa3f7
3
+ metadata.gz: 53663e0ed4b522336c69b73073aa144a4b6c8178e3fcd716c0e4519a66e308ba
4
+ data.tar.gz: b60d0c55dce9e1e9a23eb7e6ce4c445bf01340dcfd459d50716d7cd85e405b93
5
5
  SHA512:
6
- metadata.gz: 593c2807ff16f1381a0189e4babdad3ab366ad66057e4af1b083611fb204d55ae9434bf989550f8371de7586be55fe4f8a760f84f2424323a9189803583e9243
7
- data.tar.gz: 1239bb86dfad9fcee2b0dc4dc2fc8458306e877afd2aa1e722b9e4db7072b71658469bf48b425959c52111fac2cc8bb5dbbb11435263a199f036ad2ee4697228
6
+ metadata.gz: 6e1baf64882c857abdd3fd02b77785a783a8694854358c78a9da3be213b42ac88e36805ebf7f10f0d87fb14d7808302e1afffd2793c5ffc21addec5326e5f969
7
+ data.tar.gz: e5a65140ca8704c7443f88404cfb9e971f4a2925d756eed18d7482be74aab3243315fda727dfe8fed13d0732d76ca442a12cb7af200ca6ae3e4de4b0f1bab1a2
@@ -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 Procs - which can't be
336
- # marshaled until we run the following code.
337
- def marshalize(block)
338
- unless block.respond_to?(:_dump) || block.respond_to?(:_dump_data)
339
- def block._dump(_)
340
- to_s
341
- end
342
- end
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
@@ -1,3 +1,3 @@
1
1
  module Scientist
2
- VERSION = "1.6.2"
2
+ VERSION = "1.6.3"
3
3
  end
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.2
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-11-04 00:00:00.000000000 Z
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.22
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.