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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10fceaf377e0b3e836d00eb70815db609c97ab0de3e7d0230062fef0173a726b
|
4
|
+
data.tar.gz: 5dfd49e0d758531082d07d793f6a33e28d2624cce7f8220cae6cf076f8bfd860
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3bff74cdcc0b61f0119c00a253621d01cd6e96ca982ebec2eb20da5a36a7f2cb4ac012d3a9f554b31fc14f2746d39219247462a9b70a6bfc459966b21150d84d
|
7
|
+
data.tar.gz: 489365792f89b05b4b75056da0b62a4aba7c62969ddf3a70e2541882459bb3a38a8958462a8bde5334f5f99fffeece4a91f812724459f102d938cd303786eaab
|
data/Gemfile.lock
CHANGED
@@ -62,7 +62,13 @@ module CommaSplice
|
|
62
62
|
@headers.size < @values.size
|
63
63
|
end
|
64
64
|
|
65
|
-
|
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
|
@@ -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
|
-
|
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
|
data/lib/comma_splice/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2020-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|