crude-mutant 0.3.4 → 0.4.0

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: a18d6acfaaa46ba4644b7a14b1b27ae8984d25ed6bdcee106b30a9ae99da2ad8
4
- data.tar.gz: be17b0e79ae65ed62d6948d3e4b55e00eb3808ffadeebb4d8c1f9bdfd9396e75
3
+ metadata.gz: 19c815febd49e6c18227d79fb6bbfa5631daffd774815f463b03d6a388477977
4
+ data.tar.gz: 37a01fd449bb4f6936b6339a8a4a67f01e5361420a1071964f0f5df4fbac8937
5
5
  SHA512:
6
- metadata.gz: 020e0f63d8eb3a9b694ff8193f1ff9e342d1006b4f7bf7ab4568136c8c7283b6ff167bc83ab786244e1d09165b031637b7981ab47b33c2d38a384b4703a93e56
7
- data.tar.gz: 5e317470c952584aad54694108678d53089567d77243b27fd19c8ec4245c0fdc0759e06b3baa21aaf0e1199b781525b6ac0925d1c792986bc2e0f86f901fecd2
6
+ metadata.gz: 51e74c6a4b27d632a04773826254ed7bf66467761ba989a6c8a7183fe42e016603d416cd15f7503e63b93533a1c2267350c6fbcb26159d880cadbf9d2589d77b
7
+ data.tar.gz: e59ec07800f047ae6f676d358ee2605597617a58a945644feb77376e670c3d19b82848d7e1924f252d5d86532974306295b13dc5c3a5e3215689a383a9df24aa
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- crude-mutant (0.3.4)
4
+ crude-mutant (0.4.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/exe/cm CHANGED
@@ -7,15 +7,27 @@ require "optparse"
7
7
  file_to_mutate = ARGV.pop
8
8
  test_command = ARGV.pop
9
9
 
10
- Options = Struct.new(:use_json_printer)
10
+ Options = Struct.new(
11
+ :use_json_printer,
12
+ :section,
13
+ :section_total,
14
+ )
11
15
 
12
- args = Options.new(false)
16
+ args = Options.new(false, 1, 1)
13
17
  OptionParser.new do |opts|
14
18
  opts.banner = "Usage: crude-mutant [options] [test command] [file to mutate]"
15
19
 
16
20
  opts.on("-j", "--json", "Print JSON out to STDOUT") do |v|
17
21
  args.use_json_printer = v
18
22
  end
23
+
24
+ opts.on("-sSECTION", "--name=SECTION", "Number of current section when parallelizing") do |s|
25
+ args.section = s
26
+ end
27
+
28
+ opts.on("-sSECTION_TOTAL", "--name=SECTION_TOTAL", "Number of total sectionswhen parallelizing") do |s|
29
+ args.section_total = s
30
+ end
19
31
  end.parse!
20
32
 
21
33
  if !file_to_mutate || !test_command
@@ -29,9 +41,9 @@ end
29
41
  printer = args.use_json_printer ? :json : :standard
30
42
 
31
43
  if printer == :json
32
- CrudeMutant.start(file_to_mutate, test_command, result_printer: printer)
44
+ CrudeMutant.start(file_to_mutate, test_command, result_printer: printer, section: args.section, total_sections: args.section_total)
33
45
  else
34
- CrudeMutant.start(file_to_mutate, test_command, result_printer: printer) do |progress|
46
+ CrudeMutant.start(file_to_mutate, test_command, result_printer: printer, section: args.section, total_sections: args.section_total) do |progress|
35
47
  clear_string = ' ' * CrudeMutant::TerminalCalculator.new.calculate_length
36
48
  $stdout.print clear_string
37
49
  $stdout.print "\r"
data/exe/crude-mutant CHANGED
@@ -7,15 +7,27 @@ require "optparse"
7
7
  file_to_mutate = ARGV.pop
8
8
  test_command = ARGV.pop
9
9
 
10
- Options = Struct.new(:use_json_printer)
10
+ Options = Struct.new(
11
+ :use_json_printer,
12
+ :section,
13
+ :section_total,
14
+ )
11
15
 
12
- args = Options.new(false)
16
+ args = Options.new(false, 1, 1)
13
17
  OptionParser.new do |opts|
14
18
  opts.banner = "Usage: crude-mutant [options] [test command] [file to mutate]"
15
19
 
16
20
  opts.on("-j", "--json", "Print JSON out to STDOUT") do |v|
17
21
  args.use_json_printer = v
18
22
  end
23
+
24
+ opts.on("-sSECTION", "--name=SECTION", "Number of current section when parallelizing") do |s|
25
+ args.section = s
26
+ end
27
+
28
+ opts.on("-sSECTION_TOTAL", "--name=SECTION_TOTAL", "Number of total sectionswhen parallelizing") do |s|
29
+ args.section_total = s
30
+ end
19
31
  end.parse!
20
32
 
21
33
  if !file_to_mutate || !test_command
@@ -29,9 +41,9 @@ end
29
41
  printer = args.use_json_printer ? :json : :standard
30
42
 
31
43
  if printer == :json
32
- CrudeMutant.start(file_to_mutate, test_command, result_printer: printer)
44
+ CrudeMutant.start(file_to_mutate, test_command, result_printer: printer, section: args.section, total_sections: args.section_total)
33
45
  else
34
- CrudeMutant.start(file_to_mutate, test_command, result_printer: printer) do |progress|
46
+ CrudeMutant.start(file_to_mutate, test_command, result_printer: printer, section: args.section, total_sections: args.section_total) do |progress|
35
47
  clear_string = ' ' * CrudeMutant::TerminalCalculator.new.calculate_length
36
48
  $stdout.print clear_string
37
49
  $stdout.print "\r"
@@ -18,7 +18,6 @@ module CrudeMutant
18
18
  @file_path = file_path
19
19
  @contents_as_array = contents_as_array
20
20
  end
21
- private_class_method :new
22
21
 
23
22
  def lines_in_file
24
23
  @contents_as_array.size
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CrudeMutant
4
- VERSION = "0.3.4"
4
+ VERSION = "0.4.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crude-mutant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kelly Sutton