comma_splice 0.2.2 → 0.2.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: 7f6b56980107ae3e81c5d61f6331f4eedcd21d6120f145f6a3b4e18c79a4d63b
4
- data.tar.gz: cf3bac98bb36e2a94f6d939b54496d803cbc7078ee044b1972f66450b667628e
3
+ metadata.gz: 10fceaf377e0b3e836d00eb70815db609c97ab0de3e7d0230062fef0173a726b
4
+ data.tar.gz: 5dfd49e0d758531082d07d793f6a33e28d2624cce7f8220cae6cf076f8bfd860
5
5
  SHA512:
6
- metadata.gz: 17025c468ae170c2e7a3a3b8555072208181e1a020dbd835d8ee4ced13d7dd91c8eca4f99b6c27ce25b279e2f6a2354c0af734c42446a2cf31375d572d8c283d
7
- data.tar.gz: dd0bf6268d3ee42443a143e6d99df65c56bb65703eddf0e67f10d86651af9c7a56f2ae3199bb31d39a03ae1d7cc673a4de9278abb6922e0fd5ce8dd68e082bf1
6
+ metadata.gz: 3bff74cdcc0b61f0119c00a253621d01cd6e96ca982ebec2eb20da5a36a7f2cb4ac012d3a9f554b31fc14f2746d39219247462a9b70a6bfc459966b21150d84d
7
+ data.tar.gz: 489365792f89b05b4b75056da0b62a4aba7c62969ddf3a70e2541882459bb3a38a8958462a8bde5334f5f99fffeece4a91f812724459f102d938cd303786eaab
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- comma_splice (0.2.2)
4
+ comma_splice (0.2.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -62,7 +62,13 @@ module CommaSplice
62
62
  @headers.size < @values.size
63
63
  end
64
64
 
65
- private
65
+ def print_all_options
66
+ ranked_options.each_with_index do |option, index|
67
+ print_option(option, index)
68
+ end
69
+ end
70
+
71
+ protected
66
72
 
67
73
  def join_possibilities
68
74
  JoinPossibilities.new(@values.size, @headers.size).possibilities
@@ -57,7 +57,7 @@ module CommaSplice
57
57
 
58
58
  def options_that_have_words_joined_by_commas
59
59
  option.select do |o|
60
- o.to_s.match(/[^0-9],[\w]/) || o.to_s.match(/[^\w],[0-9]/)
60
+ o.to_s.match(/[^0-9\s],[\w]/) || o.to_s.match(/[\w],[^0-9\s]/)
61
61
  end.compact.size * -5
62
62
  end
63
63
 
@@ -29,6 +29,10 @@ module CommaSplice
29
29
  corrector.best_options.size
30
30
  end
31
31
 
32
+ def all_options
33
+ corrector.ranked_options
34
+ end
35
+
32
36
  def original
33
37
  generate_csv_line(@values)
34
38
  end
@@ -48,16 +52,20 @@ module CommaSplice
48
52
  generate_csv_line([values_before, corrector.correction, values_after].flatten)
49
53
  end
50
54
 
51
- private
52
-
53
- def generate_csv_line(values)
54
- CSV.generate_line(values)
55
+ def print_all_options
56
+ corrector.print_all_options
55
57
  end
56
58
 
59
+ protected
60
+
57
61
  def corrector
58
62
  CommaCalculator.new(selected_headers, selected_values)
59
63
  end
60
64
 
65
+ def generate_csv_line(values)
66
+ CSV.generate_line(values)
67
+ end
68
+
61
69
  def selected_headers
62
70
  headers[left_bounds..right_bounds]
63
71
  end
@@ -1,3 +1,3 @@
1
1
  module CommaSplice
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: comma_splice
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Keen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-27 00:00:00.000000000 Z
11
+ date: 2020-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler