sqed 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sqed/boundaries.rb +1 -1
- data/lib/sqed/boundary_finder/color_line_finder.rb +1 -1
- data/lib/sqed/boundary_finder.rb +3 -3
- data/lib/sqed/extractor.rb +3 -3
- data/lib/sqed/version.rb +1 -1
- data/lib/sqed.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a10699c845a53421c6ea0446eac442be0470448d0c55c876bb849c2ec4a928e
|
4
|
+
data.tar.gz: b15da56bbbd2146e8683c7c19bcf3df8712c9bdb43c4015f173992e111b52520
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f7b7798e7e21145b3d46da2f68ff8b5bd83f341a7926d894d3f7253e5551eafa8297a26bd5fb0053707acca91c2fec2db42638bc27b54c13d58986b8ab6a051
|
7
|
+
data.tar.gz: b5ba7f2552f5db764f9436c77b874e7c094369d554a6df44ac15342a40177a7a80531fe1c3d87d2a34b725deeef21adec53fab1a311e0de7bf55e4a3ced64194
|
data/lib/sqed/boundaries.rb
CHANGED
@@ -24,7 +24,7 @@ class Sqed
|
|
24
24
|
attr_accessor :complete
|
25
25
|
|
26
26
|
def initialize(layout = nil)
|
27
|
-
raise 'unrecognized layout' if layout && !SqedConfig::LAYOUTS.include?(layout)
|
27
|
+
raise Sqed::Error, 'unrecognized layout' if layout && !SqedConfig::LAYOUTS.include?(layout)
|
28
28
|
@complete = false
|
29
29
|
|
30
30
|
@layout = layout
|
@@ -15,7 +15,7 @@ class Sqed::BoundaryFinder::ColorLineFinder < Sqed::BoundaryFinder
|
|
15
15
|
|
16
16
|
super(image: image, layout: layout, use_thumbnail: use_thumbnail)
|
17
17
|
|
18
|
-
raise 'No layout provided.' if @layout.nil?
|
18
|
+
raise Sqed::Error, 'No layout provided.' if @layout.nil?
|
19
19
|
|
20
20
|
# !@#? why this
|
21
21
|
@boundary_color = boundary_color
|
data/lib/sqed/boundary_finder.rb
CHANGED
@@ -33,8 +33,8 @@ class Sqed
|
|
33
33
|
@layout = opts[:layout]
|
34
34
|
@image = opts[:image]
|
35
35
|
|
36
|
-
raise 'No layout provided.' if layout.nil?
|
37
|
-
raise 'No image provided.' if image.nil? || image.class.name != 'Magick::Image'
|
36
|
+
raise Sqed::Error, 'No layout provided.' if layout.nil?
|
37
|
+
raise Sqed::Error, 'No image provided.' if image.nil? || image.class.name != 'Magick::Image'
|
38
38
|
|
39
39
|
true
|
40
40
|
end
|
@@ -166,7 +166,7 @@ class Sqed
|
|
166
166
|
elsif scan == :columns
|
167
167
|
j = image.crop(s * sample_subdivision_size, 0, 1, image.rows, true)
|
168
168
|
else
|
169
|
-
raise
|
169
|
+
raise Sqed::Error
|
170
170
|
end
|
171
171
|
|
172
172
|
j.each_pixel do |pixel, c, r|
|
data/lib/sqed/extractor.rb
CHANGED
@@ -23,9 +23,9 @@ class Sqed
|
|
23
23
|
@boundaries = opts[:boundaries]
|
24
24
|
@image = opts[:image]
|
25
25
|
|
26
|
-
raise Error, 'boundaries not provided or provided boundary is not a Sqed::Boundaries' if boundaries.nil? || !boundaries.class.name == 'Sqed::Boundaries'
|
27
|
-
raise Error, 'metadata_map not provided or metadata_map not a Hash' if metadata_map.nil? || !metadata_map.class.name == 'Hash'
|
28
|
-
raise Error, 'image not provided' if image.nil? || !image.class.name == 'Magick::Image'
|
26
|
+
raise Sqed::Error, 'boundaries not provided or provided boundary is not a Sqed::Boundaries' if boundaries.nil? || !boundaries.class.name == 'Sqed::Boundaries'
|
27
|
+
raise Sqed::Error, 'metadata_map not provided or metadata_map not a Hash' if metadata_map.nil? || !metadata_map.class.name == 'Hash'
|
28
|
+
raise Sqed::Error, 'image not provided' if image.nil? || !image.class.name == 'Magick::Image'
|
29
29
|
end
|
30
30
|
|
31
31
|
def result
|
data/lib/sqed/version.rb
CHANGED
data/lib/sqed.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# encoding: UTF-8
|
2
2
|
|
3
3
|
recent_ruby = RUBY_VERSION >= '2.4.1'
|
4
|
-
raise 'IMPORTANT: sqed gem requires ruby >= 2.4.1' unless recent_ruby
|
4
|
+
raise Sqed::Error, 'IMPORTANT: sqed gem requires ruby >= 2.4.1' unless recent_ruby
|
5
5
|
|
6
6
|
require 'rmagick'
|
7
7
|
require 'sqed_utils'
|
@@ -183,7 +183,7 @@ class Sqed
|
|
183
183
|
def configure_from_pattern(value)
|
184
184
|
return if value.nil?
|
185
185
|
value = value.to_sym
|
186
|
-
raise "provided extraction pattern '#{value}' not defined" if !SqedConfig::EXTRACTION_PATTERNS.keys.include?(value)
|
186
|
+
raise Sqed::Error, "provided extraction pattern '#{value}' not defined" if !SqedConfig::EXTRACTION_PATTERNS.keys.include?(value)
|
187
187
|
@pattern = value
|
188
188
|
a = SqedConfig::EXTRACTION_PATTERNS[pattern]
|
189
189
|
@boundary_finder = a[:boundary_finder]
|
@@ -237,7 +237,7 @@ class Sqed
|
|
237
237
|
if boundary.populated?
|
238
238
|
@stage_boundary.set(0, boundary.for(0))
|
239
239
|
else
|
240
|
-
raise 'error detecting stage'
|
240
|
+
raise Sqed::Error, 'error detecting stage'
|
241
241
|
end
|
242
242
|
else
|
243
243
|
@stage_boundary.set(0, [0, 0, image.columns, image.rows])
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sqed
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Yoder
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-
|
12
|
+
date: 2022-06-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|