mutant 0.11.9 → 0.11.10

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: 6cfe7ef3344fe2802cd0004827386547ff6e67adadfd7117bb51d3dadb8ed53d
4
- data.tar.gz: f8aae5c34fa4ec0c98245641ab1773a8fe0917c56c045c0859016febdaa9e4e3
3
+ metadata.gz: 163279d053e71f375fc6854b89e1ca0730d7de6a1cf883772097a635067fdc92
4
+ data.tar.gz: c943e8ad5544a90d967ac9c580557a1e41997de4a2363cffe829710f0a71c8ae
5
5
  SHA512:
6
- metadata.gz: a5c05d42faaeec2ef7e70defece4cbf35cfb5d726aefcbcc97b0ffce260851a20d2ce1815bcf0776b14d7eb1e5aef94fde299c220997f3a0d20e4acfb71b18eb
7
- data.tar.gz: 2c102205b6d798214da493c263e21f587ad86354a4ff8a389ac091ec2bc212c63d563e8e5aec867c21d277e3a7881e1f3981df625324e3801eb5ff23fcf7dc20
6
+ metadata.gz: 1a130b60a8e53fb84d6b95897bc2749007df58d114b8201ac409eb40f203ee9f90804df51f49083c345784d420335eaeaa884299e0c1d37634be6d72875b5580
7
+ data.tar.gz: 18845045b045a1692c5574c092f7035560cab6267a8bd2a904266a69919630df59a47e0cc0d6edfc32717c834824b1b8d698da979aa7480359d363c1df9f1c1f
@@ -8,25 +8,25 @@ module Mutant
8
8
  class NamedGroup < Node
9
9
  handle(:regexp_named_group)
10
10
 
11
- children :name, :group
11
+ children :name
12
12
 
13
13
  private
14
14
 
15
15
  def dispatch
16
- return unless group
16
+ return if remaining_children.empty?
17
17
 
18
- emit_group_mutations
18
+ remaining_children_indices.each(&method(:mutate_child))
19
19
 
20
20
  # Allows unused captures to be kept and named if they are explicitly prefixed with an
21
21
  # underscore, like we allow with unused local variables.
22
22
  return if name_underscored?
23
23
 
24
- emit(s(:regexp_passive_group, group))
24
+ emit(s(:regexp_passive_group, *remaining_children))
25
25
  emit_name_underscore_mutation
26
26
  end
27
27
 
28
28
  def emit_name_underscore_mutation
29
- emit_type("_#{name}", group)
29
+ emit_type("_#{name}", *remaining_children)
30
30
  end
31
31
 
32
32
  def name_underscored?
@@ -4,7 +4,7 @@ module Mutant
4
4
  module Parallel
5
5
  # Driver for parallelized execution
6
6
  class Driver
7
- include Adamantium, Anima.new(
7
+ include Anima.new(
8
8
  :threads,
9
9
  :var_active_jobs,
10
10
  :var_final,
@@ -16,6 +16,11 @@ module Mutant
16
16
 
17
17
  private(*anima.attribute_names)
18
18
 
19
+ def initialize(**attributes)
20
+ @alive = true
21
+ super
22
+ end
23
+
19
24
  # Wait for computation to finish, with timeout
20
25
  #
21
26
  # @param [Float] timeout
@@ -23,11 +28,22 @@ module Mutant
23
28
  # @return [Variable::Result<Sink#status>]
24
29
  # current status
25
30
  def wait_timeout(timeout)
26
- var_final.take_timeout(timeout)
31
+ var_final.take_timeout(timeout) if @alive
27
32
 
28
33
  finalize(status)
29
34
  end
30
35
 
36
+ # Stop parallel computation
37
+ #
38
+ # This will cause all work to be immediately stopped.
39
+ #
40
+ # @return [self]
41
+ def stop
42
+ @alive = false
43
+ threads.each(&:kill)
44
+ self
45
+ end
46
+
31
47
  private
32
48
 
33
49
  def finalize(status)
data/lib/mutant/runner.rb CHANGED
@@ -25,6 +25,10 @@ module Mutant
25
25
  private_class_method :run_mutation_analysis
26
26
 
27
27
  def self.run_driver(reporter, driver)
28
+ Signal.trap('INT') do
29
+ driver.stop
30
+ end
31
+
28
32
  loop do
29
33
  status = driver.wait_timeout(reporter.delay)
30
34
  break status.payload if status.done?
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Mutant
4
4
  # Current mutant version
5
- VERSION = '0.11.9'
5
+ VERSION = '0.11.10'
6
6
  end # Mutant
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mutant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.9
4
+ version: 0.11.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Markus Schirp
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-01 00:00:00.000000000 Z
11
+ date: 2022-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: diff-lcs