percept 0.0.1 → 3.0.0
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 +5 -5
- data/.github/workflows/ruby.yml +34 -0
- data/.gitignore +3 -1
- data/.rspec +3 -0
- data/.rubocop.yml +110 -0
- data/.rubocop_todo.yml +383 -0
- data/.tool-versions +2 -0
- data/Gemfile +12 -1
- data/Gemfile.lock +138 -0
- data/Guardfile +10 -0
- data/README.md +20 -0
- data/Rakefile +18 -0
- data/bin/percept +8 -1
- data/lib/ext/rmagick_pixel.rb +19 -0
- data/lib/percept/checkbox_collection.rb +19 -0
- data/lib/percept/checkbox_detector.rb +19 -0
- data/lib/percept/checkbox_field.rb +24 -0
- data/lib/percept/color_utils.rb +17 -0
- data/lib/percept/config.rb +35 -0
- data/lib/percept/field.rb +74 -0
- data/lib/percept/field_collection.rb +29 -0
- data/lib/percept/field_detector.rb +56 -0
- data/lib/percept/image.rb +60 -0
- data/lib/percept/line.rb +116 -4
- data/lib/percept/line_collection.rb +88 -0
- data/lib/percept/line_detector.rb +102 -0
- data/lib/percept/line_filter.rb +95 -0
- data/lib/percept/pixel.rb +28 -0
- data/lib/percept/pixel_utils.rb +73 -0
- data/lib/percept/rmagick_image.rb +49 -0
- data/lib/percept/runner.rb +15 -96
- data/lib/percept/utils.rb +15 -0
- data/lib/percept/version.rb +3 -1
- data/lib/percept.rb +40 -1
- data/percept.gemspec +6 -7
- data/spec/fixtures/black_lines.png +0 -0
- data/spec/fixtures/bottom_line.png +0 -0
- data/spec/fixtures/bumpy_no_line.png +0 -0
- data/spec/fixtures/corners.png +0 -0
- data/spec/fixtures/divots.png +0 -0
- data/spec/fixtures/field_next_to_text.png +0 -0
- data/spec/fixtures/gray_cell_bottom.png +0 -0
- data/spec/fixtures/gray_image_section.png +0 -0
- data/spec/fixtures/grey_lines.png +0 -0
- data/spec/fixtures/high_line.png +0 -0
- data/spec/fixtures/large_checkbox.png +0 -0
- data/spec/fixtures/large_checkboxes.png +0 -0
- data/spec/fixtures/light_gray.png +0 -0
- data/spec/fixtures/low_line.png +0 -0
- data/spec/fixtures/low_lines.png +0 -0
- data/spec/fixtures/mid_lines.png +0 -0
- data/spec/fixtures/more_corners.png +0 -0
- data/spec/fixtures/more_text_on_line.png +0 -0
- data/spec/fixtures/nub_both_sides.png +0 -0
- data/spec/fixtures/nub_bottom_left.png +0 -0
- data/spec/fixtures/nub_top_right.png +0 -0
- data/spec/fixtures/nubs.png +0 -0
- data/spec/fixtures/slanted_left.png +0 -0
- data/spec/fixtures/slanted_right.png +0 -0
- data/spec/fixtures/small_checkbox.png +0 -0
- data/spec/fixtures/text_no_line.png +0 -0
- data/spec/fixtures/text_no_line_2.png +0 -0
- data/spec/fixtures/text_on_line.png +0 -0
- data/spec/fixtures/thick_line.png +0 -0
- data/spec/fixtures/thin_field.png +0 -0
- data/spec/percept/checkbox_field/height_spec.rb +15 -0
- data/spec/percept/checkbox_field/width_spec.rb +15 -0
- data/spec/percept/field/contains_spec.rb +50 -0
- data/spec/percept/field_detector/detect_field_spec.rb +90 -0
- data/spec/percept/field_detector/detect_fields_spec.rb +42 -0
- data/spec/percept/fields_collection/shovel_spec.rb +53 -0
- data/spec/percept/line/approxequals_spec.rb +60 -0
- data/spec/percept/line/initialize_spec.rb +29 -0
- data/spec/percept/line/length_spec.rb +22 -0
- data/spec/percept/line/merge_bang_spec.rb +58 -0
- data/spec/percept/line/pixels_spec.rb +15 -0
- data/spec/percept/line/split_spec.rb +28 -0
- data/spec/percept/line/to_s_spec.rb +13 -0
- data/spec/percept/line_collection/merge_line_spec.rb +50 -0
- data/spec/percept/line_collection/remove_unwanted_lines_bang_spec.rb +17 -0
- data/spec/percept/line_collection/split_spec.rb +20 -0
- data/spec/percept/line_collection/to_s_spec.rb +11 -0
- data/spec/percept/line_detector/detect_lines_spec.rb +93 -0
- data/spec/percept/line_detector/scaled_color_spec.rb +14 -0
- data/spec/percept/line_filter/filter_line_predicate_spec.rb +29 -0
- data/spec/percept/line_filter/left_bottom_corner_predicate_spec.rb +49 -0
- data/spec/percept/line_filter/left_top_corner_predicate_spec.rb +50 -0
- data/spec/percept/line_filter/right_bottom_corner_predicate_spec.rb +49 -0
- data/spec/percept/line_filter/right_top_corner_predicate_spec.rb +49 -0
- data/spec/percept/line_filter/table_bottom_predicate_spec.rb +48 -0
- data/spec/percept/line_filter/table_top_predicate_spec.rb +48 -0
- data/spec/percept/pixel/blackish_predicate_spec.rb +36 -0
- data/spec/percept/rmagick_image/interface_spec.rb +11 -0
- data/spec/percept/runner/color_fields_spec.rb +28 -0
- data/spec/percept/runner/color_lines_spec.rb +27 -0
- data/spec/shared_examples/image_interface_shared_examples.rb +162 -0
- data/spec/spec_helper.rb +52 -0
- data/tddium.yml +12 -0
- data/test_images/funky_image.png +0 -0
- data/test_images/interaction_test.png +0 -0
- data/test_images/jagged_lines.png +0 -0
- data/test_images/permission.png +0 -0
- data/test_images/rough.png +0 -0
- data/test_images/slanted.png +0 -0
- data/test_images/time_sheet.png +0 -0
- data/test_images/travel_reimbursement.png +0 -0
- data/test_images/warehouse_form.png +0 -0
- metadata +171 -34
- data/new_permission.png +0 -0
- data/permission.png +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 15d6b341877e0bd9ffa7c22b71eb45c7eafea2bfe2b0e6d398fa4549c85c7862
|
4
|
+
data.tar.gz: 0aef42b9b5e0cb849639d9ed58f12faf31b152a3d50aec3f55af33ae35602c88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b09a9899c7939b833237b142ab773a282ce2edd85f6c18e68f6fa557a80d37d373c424401b5c1bb94a890f0073a6735203ac74cae60c2bcaafc68d23d1941773
|
7
|
+
data.tar.gz: 7702ec1c90fc7c6376e40343ee748c794b49a60552b97efca1d26dd0d220b9f6d918c7552c8cd31bb88e07e02c3f03d4b2dcde67aa44a2a75f1516c4c4af4dba
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# This workflow uses actions that are not certified by GitHub.
|
2
|
+
# They are provided by a third-party and are governed by
|
3
|
+
# separate terms of service, privacy policy, and support
|
4
|
+
# documentation.
|
5
|
+
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
|
6
|
+
|
7
|
+
name: Ruby
|
8
|
+
|
9
|
+
on:
|
10
|
+
push:
|
11
|
+
branches: [ main ]
|
12
|
+
pull_request:
|
13
|
+
branches: [ main ]
|
14
|
+
|
15
|
+
jobs:
|
16
|
+
test:
|
17
|
+
runs-on: ubuntu-latest
|
18
|
+
strategy:
|
19
|
+
matrix:
|
20
|
+
ruby: [3.3, 3.4]
|
21
|
+
name: Ruby ${{ matrix.ruby }}
|
22
|
+
steps:
|
23
|
+
- uses: actions/checkout@v2
|
24
|
+
- name: Set up Ruby
|
25
|
+
uses: ruby/setup-ruby@v1
|
26
|
+
with:
|
27
|
+
ruby-version: ${{ matrix.ruby }}
|
28
|
+
bundler: 2
|
29
|
+
- name: Install dependencies
|
30
|
+
run: |
|
31
|
+
sudo apt-get update && sudo apt-get install -y libmagickwand-dev
|
32
|
+
bundle install
|
33
|
+
- name: Run Tests
|
34
|
+
run: bundle exec rake
|
data/.gitignore
CHANGED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,110 @@
|
|
1
|
+
inherit_from: .rubocop_todo.yml
|
2
|
+
|
3
|
+
plugins:
|
4
|
+
- rubocop-rake
|
5
|
+
- rubocop-rspec
|
6
|
+
|
7
|
+
AllCops:
|
8
|
+
Exclude:
|
9
|
+
- rgloader/loader.rb
|
10
|
+
- !ruby/regexp /.*tddium.*\.rb$/
|
11
|
+
NewCops: enable
|
12
|
+
|
13
|
+
Style/Documentation:
|
14
|
+
Enabled: false
|
15
|
+
|
16
|
+
Layout/AccessModifierIndentation:
|
17
|
+
EnforcedStyle: outdent
|
18
|
+
|
19
|
+
CollectionMethods:
|
20
|
+
PreferredMethods:
|
21
|
+
collect: 'map'
|
22
|
+
collect!: 'map!'
|
23
|
+
inject: 'reduce'
|
24
|
+
find: 'detect'
|
25
|
+
find_all: 'select'
|
26
|
+
|
27
|
+
Layout/EmptyLinesAroundBlockBody:
|
28
|
+
Enabled: false
|
29
|
+
|
30
|
+
Layout/EmptyLinesAroundClassBody:
|
31
|
+
EnforcedStyle: empty_lines
|
32
|
+
|
33
|
+
Layout/EmptyLinesAroundModuleBody:
|
34
|
+
EnforcedStyle: empty_lines
|
35
|
+
|
36
|
+
Layout/SpaceAroundMethodCallOperator:
|
37
|
+
Enabled: true
|
38
|
+
|
39
|
+
Lint/RaiseException:
|
40
|
+
Enabled: true
|
41
|
+
AllowedImplicitNamespaces: []
|
42
|
+
|
43
|
+
Lint/StructNewOverride:
|
44
|
+
Enabled: true
|
45
|
+
|
46
|
+
Style/ExponentialNotation:
|
47
|
+
Enabled: true
|
48
|
+
EnforcedStyle: scientific
|
49
|
+
|
50
|
+
Style/HashEachMethods:
|
51
|
+
Enabled: true
|
52
|
+
|
53
|
+
Style/HashTransformKeys:
|
54
|
+
Enabled: true
|
55
|
+
|
56
|
+
Style/HashTransformValues:
|
57
|
+
Enabled: true
|
58
|
+
|
59
|
+
Style/TrailingCommaInHashLiteral:
|
60
|
+
EnforcedStyleForMultiline: comma
|
61
|
+
|
62
|
+
Style/TrailingCommaInArrayLiteral:
|
63
|
+
EnforcedStyleForMultiline: comma
|
64
|
+
|
65
|
+
|
66
|
+
Style/TrailingCommaInArguments:
|
67
|
+
EnforcedStyleForMultiline: comma
|
68
|
+
|
69
|
+
# this should be removed at some point if possible
|
70
|
+
Metrics/MethodLength:
|
71
|
+
Max: 30
|
72
|
+
|
73
|
+
Metrics/ClassLength:
|
74
|
+
Max: 150
|
75
|
+
|
76
|
+
Metrics/AbcSize:
|
77
|
+
Max: 35
|
78
|
+
|
79
|
+
Style/NumericPredicate:
|
80
|
+
Enabled: true
|
81
|
+
|
82
|
+
Style/MutableConstant:
|
83
|
+
Enabled: true
|
84
|
+
|
85
|
+
Style/SignalException:
|
86
|
+
Enabled: true
|
87
|
+
|
88
|
+
Style/GuardClause:
|
89
|
+
Enabled: false
|
90
|
+
|
91
|
+
Style/Alias:
|
92
|
+
Enabled: true
|
93
|
+
|
94
|
+
Bundler/OrderedGems:
|
95
|
+
Enabled: false
|
96
|
+
|
97
|
+
Style/EmptyMethod:
|
98
|
+
Enabled: false
|
99
|
+
|
100
|
+
Style/InverseMethods:
|
101
|
+
Enabled: false
|
102
|
+
|
103
|
+
Metrics/BlockLength:
|
104
|
+
Enabled: false
|
105
|
+
|
106
|
+
Style/PercentLiteralDelimiters:
|
107
|
+
Enabled: false
|
108
|
+
|
109
|
+
Naming/VariableNumber:
|
110
|
+
Enabled: false
|
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,383 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config --auto-gen-only-exclude --exclude-limit 400`
|
3
|
+
# on 2024-08-27 15:57:52 UTC using RuboCop version 1.65.1.
|
4
|
+
# The point is for the user to remove these configuration records
|
5
|
+
# one by one as the offenses are removed from the code base.
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
8
|
+
|
9
|
+
# Offense count: 1
|
10
|
+
# This cop supports safe autocorrection (--autocorrect).
|
11
|
+
# Configuration parameters: Include.
|
12
|
+
# Include: **/*.gemspec
|
13
|
+
Gemspec/AddRuntimeDependency:
|
14
|
+
Exclude:
|
15
|
+
- 'percept.gemspec'
|
16
|
+
|
17
|
+
# Offense count: 1
|
18
|
+
# This cop supports safe autocorrection (--autocorrect).
|
19
|
+
# Configuration parameters: Severity, Include.
|
20
|
+
# Include: **/*.gemspec
|
21
|
+
Gemspec/DeprecatedAttributeAssignment:
|
22
|
+
Exclude:
|
23
|
+
- 'percept.gemspec'
|
24
|
+
|
25
|
+
# Offense count: 1
|
26
|
+
# This cop supports safe autocorrection (--autocorrect).
|
27
|
+
# Configuration parameters: Severity, Include.
|
28
|
+
# Include: **/*.gemspec
|
29
|
+
Gemspec/RequireMFA:
|
30
|
+
Exclude:
|
31
|
+
- 'percept.gemspec'
|
32
|
+
|
33
|
+
# Offense count: 1
|
34
|
+
# Configuration parameters: Severity, Include.
|
35
|
+
# Include: **/*.gemspec
|
36
|
+
Gemspec/RequiredRubyVersion:
|
37
|
+
Exclude:
|
38
|
+
- 'percept.gemspec'
|
39
|
+
|
40
|
+
# Offense count: 4
|
41
|
+
# This cop supports safe autocorrection (--autocorrect).
|
42
|
+
Layout/EmptyLineAfterGuardClause:
|
43
|
+
Exclude:
|
44
|
+
- 'lib/ext/rmagick_pixel.rb'
|
45
|
+
- 'lib/percept/line.rb'
|
46
|
+
|
47
|
+
# Offense count: 1
|
48
|
+
# This cop supports safe autocorrection (--autocorrect).
|
49
|
+
# Configuration parameters: EnforcedStyle, IndentationWidth.
|
50
|
+
# SupportedStyles: aligned, indented
|
51
|
+
Layout/LineEndStringConcatenationIndentation:
|
52
|
+
Exclude:
|
53
|
+
- 'lib/percept/image.rb'
|
54
|
+
|
55
|
+
# Offense count: 6
|
56
|
+
# This cop supports safe autocorrection (--autocorrect).
|
57
|
+
Lint/AmbiguousOperatorPrecedence:
|
58
|
+
Exclude:
|
59
|
+
- 'lib/ext/rmagick_pixel.rb'
|
60
|
+
- 'lib/percept/field_detector.rb'
|
61
|
+
- 'lib/percept/line_collection.rb'
|
62
|
+
- 'lib/percept/line_detector.rb'
|
63
|
+
|
64
|
+
# Offense count: 1
|
65
|
+
# Configuration parameters: AllowedParentClasses.
|
66
|
+
Lint/MissingSuper:
|
67
|
+
Exclude:
|
68
|
+
- 'lib/percept/rmagick_image.rb'
|
69
|
+
|
70
|
+
# Offense count: 2
|
71
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
72
|
+
Lint/NonAtomicFileOperation:
|
73
|
+
Exclude:
|
74
|
+
- 'spec/spec_helper.rb'
|
75
|
+
|
76
|
+
# Offense count: 1
|
77
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns, Max.
|
78
|
+
Metrics/CyclomaticComplexity:
|
79
|
+
Exclude:
|
80
|
+
- 'lib/percept/config.rb'
|
81
|
+
|
82
|
+
# Offense count: 1
|
83
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns, Max.
|
84
|
+
Metrics/PerceivedComplexity:
|
85
|
+
Exclude:
|
86
|
+
- 'lib/percept/config.rb'
|
87
|
+
|
88
|
+
# Offense count: 6
|
89
|
+
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
|
90
|
+
# AllowedNames: as, at, by, cc, db, id, if, in, io, ip, of, on, os, pp, to
|
91
|
+
Naming/MethodParameterName:
|
92
|
+
Exclude:
|
93
|
+
- 'lib/percept/image.rb'
|
94
|
+
- 'lib/percept/rmagick_image.rb'
|
95
|
+
|
96
|
+
# Offense count: 130
|
97
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
98
|
+
RSpec/BeEq:
|
99
|
+
Exclude:
|
100
|
+
- 'spec/percept/field/contains_spec.rb'
|
101
|
+
- 'spec/percept/line/pixels_spec.rb'
|
102
|
+
- 'spec/percept/line_filter/left_bottom_corner_predicate_spec.rb'
|
103
|
+
- 'spec/percept/line_filter/left_top_corner_predicate_spec.rb'
|
104
|
+
- 'spec/percept/line_filter/right_bottom_corner_predicate_spec.rb'
|
105
|
+
- 'spec/percept/line_filter/right_top_corner_predicate_spec.rb'
|
106
|
+
- 'spec/percept/line_filter/table_bottom_predicate_spec.rb'
|
107
|
+
- 'spec/percept/line_filter/table_top_predicate_spec.rb'
|
108
|
+
- 'spec/percept/pixel/blackish_predicate_spec.rb'
|
109
|
+
|
110
|
+
# Offense count: 4
|
111
|
+
# Configuration parameters: Prefixes, AllowedPatterns.
|
112
|
+
# Prefixes: when, with, without
|
113
|
+
RSpec/ContextWording:
|
114
|
+
Exclude:
|
115
|
+
- 'spec/percept/pixel/blackish_predicate_spec.rb'
|
116
|
+
|
117
|
+
# Offense count: 51
|
118
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
119
|
+
# Configuration parameters: SkipBlocks, EnforcedStyle, OnlyStaticConstants.
|
120
|
+
# SupportedStyles: described_class, explicit
|
121
|
+
RSpec/DescribedClass:
|
122
|
+
Exclude:
|
123
|
+
- 'spec/percept/checkbox_field/height_spec.rb'
|
124
|
+
- 'spec/percept/checkbox_field/width_spec.rb'
|
125
|
+
- 'spec/percept/field/contains_spec.rb'
|
126
|
+
- 'spec/percept/field_detector/detect_field_spec.rb'
|
127
|
+
- 'spec/percept/field_detector/detect_fields_spec.rb'
|
128
|
+
- 'spec/percept/fields_collection/shovel_spec.rb'
|
129
|
+
- 'spec/percept/line/approxequals_spec.rb'
|
130
|
+
- 'spec/percept/line/initialize_spec.rb'
|
131
|
+
- 'spec/percept/line/length_spec.rb'
|
132
|
+
- 'spec/percept/line/merge_bang_spec.rb'
|
133
|
+
- 'spec/percept/line/to_s_spec.rb'
|
134
|
+
- 'spec/percept/line_collection/to_s_spec.rb'
|
135
|
+
- 'spec/percept/line_detector/detect_lines_spec.rb'
|
136
|
+
- 'spec/percept/line_detector/scaled_color_spec.rb'
|
137
|
+
- 'spec/percept/line_filter/filter_line_predicate_spec.rb'
|
138
|
+
- 'spec/percept/line_filter/left_bottom_corner_predicate_spec.rb'
|
139
|
+
- 'spec/percept/line_filter/left_top_corner_predicate_spec.rb'
|
140
|
+
- 'spec/percept/line_filter/right_bottom_corner_predicate_spec.rb'
|
141
|
+
- 'spec/percept/line_filter/right_top_corner_predicate_spec.rb'
|
142
|
+
- 'spec/percept/line_filter/table_bottom_predicate_spec.rb'
|
143
|
+
- 'spec/percept/line_filter/table_top_predicate_spec.rb'
|
144
|
+
- 'spec/percept/pixel/blackish_predicate_spec.rb'
|
145
|
+
- 'spec/percept/rmagick_image/interface_spec.rb'
|
146
|
+
- 'spec/percept/runner/color_fields_spec.rb'
|
147
|
+
- 'spec/percept/runner/color_lines_spec.rb'
|
148
|
+
|
149
|
+
# Offense count: 25
|
150
|
+
# Configuration parameters: Max, CountAsOne.
|
151
|
+
RSpec/ExampleLength:
|
152
|
+
Exclude:
|
153
|
+
- 'spec/percept/checkbox_field/height_spec.rb'
|
154
|
+
- 'spec/percept/checkbox_field/width_spec.rb'
|
155
|
+
- 'spec/percept/field_detector/detect_fields_spec.rb'
|
156
|
+
- 'spec/percept/line/approxequals_spec.rb'
|
157
|
+
- 'spec/percept/line/split_spec.rb'
|
158
|
+
- 'spec/percept/line_collection/split_spec.rb'
|
159
|
+
- 'spec/percept/line_detector/detect_lines_spec.rb'
|
160
|
+
- 'spec/percept/line_filter/left_bottom_corner_predicate_spec.rb'
|
161
|
+
- 'spec/percept/line_filter/left_top_corner_predicate_spec.rb'
|
162
|
+
- 'spec/percept/line_filter/right_bottom_corner_predicate_spec.rb'
|
163
|
+
- 'spec/percept/line_filter/right_top_corner_predicate_spec.rb'
|
164
|
+
- 'spec/percept/line_filter/table_bottom_predicate_spec.rb'
|
165
|
+
- 'spec/percept/line_filter/table_top_predicate_spec.rb'
|
166
|
+
- 'spec/percept/runner/color_fields_spec.rb'
|
167
|
+
- 'spec/percept/runner/color_lines_spec.rb'
|
168
|
+
- 'spec/shared_examples/image_interface_shared_examples.rb'
|
169
|
+
|
170
|
+
# Offense count: 1
|
171
|
+
# This cop supports safe autocorrection (--autocorrect).
|
172
|
+
# Configuration parameters: CustomTransform, IgnoredWords, DisallowedExamples.
|
173
|
+
# DisallowedExamples: works
|
174
|
+
RSpec/ExampleWording:
|
175
|
+
Exclude:
|
176
|
+
- 'spec/percept/line_detector/detect_lines_spec.rb'
|
177
|
+
|
178
|
+
# Offense count: 1
|
179
|
+
RSpec/ExpectInHook:
|
180
|
+
Exclude:
|
181
|
+
- 'spec/percept/fields_collection/shovel_spec.rb'
|
182
|
+
|
183
|
+
# Offense count: 24
|
184
|
+
# This cop supports safe autocorrection (--autocorrect).
|
185
|
+
# Configuration parameters: .
|
186
|
+
# SupportedStyles: implicit, each, example
|
187
|
+
RSpec/HookArgument:
|
188
|
+
EnforcedStyle: each
|
189
|
+
|
190
|
+
# Offense count: 30
|
191
|
+
# Configuration parameters: Max, AllowedIdentifiers, AllowedPatterns.
|
192
|
+
RSpec/IndexedLet:
|
193
|
+
Exclude:
|
194
|
+
- 'spec/percept/field/contains_spec.rb'
|
195
|
+
- 'spec/percept/fields_collection/shovel_spec.rb'
|
196
|
+
- 'spec/percept/line_filter/left_bottom_corner_predicate_spec.rb'
|
197
|
+
- 'spec/percept/line_filter/left_top_corner_predicate_spec.rb'
|
198
|
+
- 'spec/percept/line_filter/right_bottom_corner_predicate_spec.rb'
|
199
|
+
- 'spec/percept/line_filter/right_top_corner_predicate_spec.rb'
|
200
|
+
- 'spec/percept/line_filter/table_bottom_predicate_spec.rb'
|
201
|
+
- 'spec/percept/line_filter/table_top_predicate_spec.rb'
|
202
|
+
|
203
|
+
# Offense count: 3
|
204
|
+
# Configuration parameters: .
|
205
|
+
# SupportedStyles: have_received, receive
|
206
|
+
RSpec/MessageSpies:
|
207
|
+
EnforcedStyle: receive
|
208
|
+
|
209
|
+
# Offense count: 53
|
210
|
+
# Configuration parameters: Max.
|
211
|
+
RSpec/MultipleExpectations:
|
212
|
+
Exclude:
|
213
|
+
- 'spec/percept/checkbox_field/height_spec.rb'
|
214
|
+
- 'spec/percept/checkbox_field/width_spec.rb'
|
215
|
+
- 'spec/percept/field/contains_spec.rb'
|
216
|
+
- 'spec/percept/field_detector/detect_field_spec.rb'
|
217
|
+
- 'spec/percept/field_detector/detect_fields_spec.rb'
|
218
|
+
- 'spec/percept/line/approxequals_spec.rb'
|
219
|
+
- 'spec/percept/line/initialize_spec.rb'
|
220
|
+
- 'spec/percept/line/length_spec.rb'
|
221
|
+
- 'spec/percept/line/merge_bang_spec.rb'
|
222
|
+
- 'spec/percept/line/pixels_spec.rb'
|
223
|
+
- 'spec/percept/line/split_spec.rb'
|
224
|
+
- 'spec/percept/line_collection/merge_line_spec.rb'
|
225
|
+
- 'spec/percept/line_collection/remove_unwanted_lines_bang_spec.rb'
|
226
|
+
- 'spec/percept/line_collection/split_spec.rb'
|
227
|
+
- 'spec/percept/line_detector/detect_lines_spec.rb'
|
228
|
+
- 'spec/percept/line_detector/scaled_color_spec.rb'
|
229
|
+
- 'spec/percept/line_filter/left_bottom_corner_predicate_spec.rb'
|
230
|
+
- 'spec/percept/line_filter/left_top_corner_predicate_spec.rb'
|
231
|
+
- 'spec/percept/line_filter/right_bottom_corner_predicate_spec.rb'
|
232
|
+
- 'spec/percept/line_filter/right_top_corner_predicate_spec.rb'
|
233
|
+
- 'spec/percept/line_filter/table_bottom_predicate_spec.rb'
|
234
|
+
- 'spec/percept/line_filter/table_top_predicate_spec.rb'
|
235
|
+
- 'spec/percept/pixel/blackish_predicate_spec.rb'
|
236
|
+
- 'spec/percept/runner/color_fields_spec.rb'
|
237
|
+
- 'spec/percept/runner/color_lines_spec.rb'
|
238
|
+
- 'spec/shared_examples/image_interface_shared_examples.rb'
|
239
|
+
|
240
|
+
# Offense count: 23
|
241
|
+
# Configuration parameters: AllowSubject, Max.
|
242
|
+
RSpec/MultipleMemoizedHelpers:
|
243
|
+
Exclude:
|
244
|
+
- 'spec/percept/line_collection/merge_line_spec.rb'
|
245
|
+
- 'spec/percept/line_filter/left_bottom_corner_predicate_spec.rb'
|
246
|
+
- 'spec/percept/line_filter/left_top_corner_predicate_spec.rb'
|
247
|
+
- 'spec/percept/line_filter/right_bottom_corner_predicate_spec.rb'
|
248
|
+
- 'spec/percept/line_filter/right_top_corner_predicate_spec.rb'
|
249
|
+
- 'spec/percept/line_filter/table_bottom_predicate_spec.rb'
|
250
|
+
- 'spec/percept/line_filter/table_top_predicate_spec.rb'
|
251
|
+
|
252
|
+
# Offense count: 2
|
253
|
+
# Configuration parameters: Include, CustomTransform, IgnoreMethods, IgnoreMetadata.
|
254
|
+
# Include: **/*_spec.rb
|
255
|
+
RSpec/SpecFilePathFormat:
|
256
|
+
Exclude:
|
257
|
+
- '**/spec/routing/**/*'
|
258
|
+
- 'spec/percept/fields_collection/shovel_spec.rb'
|
259
|
+
- 'spec/percept/rmagick_image/interface_spec.rb'
|
260
|
+
|
261
|
+
# Offense count: 3
|
262
|
+
RSpec/StubbedMock:
|
263
|
+
Exclude:
|
264
|
+
- 'spec/percept/pixel/blackish_predicate_spec.rb'
|
265
|
+
|
266
|
+
# Offense count: 1
|
267
|
+
# This cop supports safe autocorrection (--autocorrect).
|
268
|
+
Rake/Desc:
|
269
|
+
Exclude:
|
270
|
+
- 'Rakefile'
|
271
|
+
|
272
|
+
# Offense count: 1
|
273
|
+
# This cop supports safe autocorrection (--autocorrect).
|
274
|
+
Style/ExpandPathArguments:
|
275
|
+
Exclude:
|
276
|
+
- 'percept.gemspec'
|
277
|
+
|
278
|
+
# Offense count: 3
|
279
|
+
# This cop supports safe autocorrection (--autocorrect).
|
280
|
+
Style/ExplicitBlockArgument:
|
281
|
+
Exclude:
|
282
|
+
- 'lib/percept/checkbox_collection.rb'
|
283
|
+
- 'lib/percept/field_collection.rb'
|
284
|
+
- 'lib/percept/line_collection.rb'
|
285
|
+
|
286
|
+
# Offense count: 58
|
287
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
288
|
+
# Configuration parameters: EnforcedStyle.
|
289
|
+
# SupportedStyles: always, always_true, never
|
290
|
+
Style/FrozenStringLiteralComment:
|
291
|
+
Exclude:
|
292
|
+
- 'Gemfile'
|
293
|
+
- 'Guardfile'
|
294
|
+
- 'Rakefile'
|
295
|
+
- 'bin/percept'
|
296
|
+
- 'lib/ext/rmagick_pixel.rb'
|
297
|
+
- 'lib/percept.rb'
|
298
|
+
- 'lib/percept/checkbox_collection.rb'
|
299
|
+
- 'lib/percept/checkbox_detector.rb'
|
300
|
+
- 'lib/percept/checkbox_field.rb'
|
301
|
+
- 'lib/percept/color_utils.rb'
|
302
|
+
- 'lib/percept/config.rb'
|
303
|
+
- 'lib/percept/field.rb'
|
304
|
+
- 'lib/percept/field_collection.rb'
|
305
|
+
- 'lib/percept/field_detector.rb'
|
306
|
+
- 'lib/percept/image.rb'
|
307
|
+
- 'lib/percept/line.rb'
|
308
|
+
- 'lib/percept/line_collection.rb'
|
309
|
+
- 'lib/percept/line_detector.rb'
|
310
|
+
- 'lib/percept/line_filter.rb'
|
311
|
+
- 'lib/percept/pixel.rb'
|
312
|
+
- 'lib/percept/pixel_utils.rb'
|
313
|
+
- 'lib/percept/rmagick_image.rb'
|
314
|
+
- 'lib/percept/runner.rb'
|
315
|
+
- 'lib/percept/utils.rb'
|
316
|
+
- 'lib/percept/version.rb'
|
317
|
+
- 'percept.gemspec'
|
318
|
+
- 'spec/percept/checkbox_field/height_spec.rb'
|
319
|
+
- 'spec/percept/checkbox_field/width_spec.rb'
|
320
|
+
- 'spec/percept/field/contains_spec.rb'
|
321
|
+
- 'spec/percept/field_detector/detect_field_spec.rb'
|
322
|
+
- 'spec/percept/field_detector/detect_fields_spec.rb'
|
323
|
+
- 'spec/percept/fields_collection/shovel_spec.rb'
|
324
|
+
- 'spec/percept/line/approxequals_spec.rb'
|
325
|
+
- 'spec/percept/line/initialize_spec.rb'
|
326
|
+
- 'spec/percept/line/length_spec.rb'
|
327
|
+
- 'spec/percept/line/merge_bang_spec.rb'
|
328
|
+
- 'spec/percept/line/pixels_spec.rb'
|
329
|
+
- 'spec/percept/line/split_spec.rb'
|
330
|
+
- 'spec/percept/line/to_s_spec.rb'
|
331
|
+
- 'spec/percept/line_collection/merge_line_spec.rb'
|
332
|
+
- 'spec/percept/line_collection/remove_unwanted_lines_bang_spec.rb'
|
333
|
+
- 'spec/percept/line_collection/split_spec.rb'
|
334
|
+
- 'spec/percept/line_collection/to_s_spec.rb'
|
335
|
+
- 'spec/percept/line_detector/detect_lines_spec.rb'
|
336
|
+
- 'spec/percept/line_detector/scaled_color_spec.rb'
|
337
|
+
- 'spec/percept/line_filter/filter_line_predicate_spec.rb'
|
338
|
+
- 'spec/percept/line_filter/left_bottom_corner_predicate_spec.rb'
|
339
|
+
- 'spec/percept/line_filter/left_top_corner_predicate_spec.rb'
|
340
|
+
- 'spec/percept/line_filter/right_bottom_corner_predicate_spec.rb'
|
341
|
+
- 'spec/percept/line_filter/right_top_corner_predicate_spec.rb'
|
342
|
+
- 'spec/percept/line_filter/table_bottom_predicate_spec.rb'
|
343
|
+
- 'spec/percept/line_filter/table_top_predicate_spec.rb'
|
344
|
+
- 'spec/percept/pixel/blackish_predicate_spec.rb'
|
345
|
+
- 'spec/percept/rmagick_image/interface_spec.rb'
|
346
|
+
- 'spec/percept/runner/color_fields_spec.rb'
|
347
|
+
- 'spec/percept/runner/color_lines_spec.rb'
|
348
|
+
- 'spec/shared_examples/image_interface_shared_examples.rb'
|
349
|
+
- 'spec/spec_helper.rb'
|
350
|
+
|
351
|
+
# Offense count: 12
|
352
|
+
# This cop supports safe autocorrection (--autocorrect).
|
353
|
+
# Configuration parameters: EnforcedStyle, EnforcedShorthandSyntax, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
|
354
|
+
# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
|
355
|
+
# SupportedShorthandSyntax: always, never, either, consistent, either_consistent
|
356
|
+
Style/HashSyntax:
|
357
|
+
Exclude:
|
358
|
+
- 'lib/percept/field_detector.rb'
|
359
|
+
- 'lib/percept/line.rb'
|
360
|
+
- 'lib/percept/line_detector.rb'
|
361
|
+
|
362
|
+
# Offense count: 8
|
363
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
364
|
+
# Configuration parameters: SafeForConstants.
|
365
|
+
Style/RedundantFetchBlock:
|
366
|
+
Exclude:
|
367
|
+
- 'lib/percept/config.rb'
|
368
|
+
|
369
|
+
# Offense count: 2
|
370
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
371
|
+
# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength.
|
372
|
+
# AllowedMethods: present?, blank?, presence, try, try!
|
373
|
+
Style/SafeNavigation:
|
374
|
+
Exclude:
|
375
|
+
- 'lib/percept/line_detector.rb'
|
376
|
+
|
377
|
+
# Offense count: 1
|
378
|
+
# This cop supports safe autocorrection (--autocorrect).
|
379
|
+
# Configuration parameters: .
|
380
|
+
# SupportedStyles: percent, brackets
|
381
|
+
Style/SymbolArray:
|
382
|
+
EnforcedStyle: percent
|
383
|
+
MinSize: 3
|
data/.tool-versions
ADDED
data/Gemfile
CHANGED
@@ -1,4 +1,15 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
|
-
# Specify your gem's dependencies in percept.gemspec
|
4
3
|
gemspec
|
4
|
+
|
5
|
+
gem 'colorize'
|
6
|
+
gem 'guard'
|
7
|
+
gem 'guard-rspec'
|
8
|
+
gem 'guard-rubocop'
|
9
|
+
gem 'rake'
|
10
|
+
gem 'rspec'
|
11
|
+
gem 'rubocop', require: false
|
12
|
+
gem 'rubocop-rake', require: false
|
13
|
+
gem 'rubocop-rspec', require: false
|
14
|
+
gem 'simplecov', require: false
|
15
|
+
gem 'rtesseract'
|