text_extractor 0.5.0 → 0.5.1

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: 6d814b19dedf7312cee41b86de5ac98115240908b9a5ef17d343eb5450d2d608
4
- data.tar.gz: d365e26b0ba0a97d5ec25854767248ceff60f91c0808a24b06cf2fb425b87864
3
+ metadata.gz: 01262caa92a85326128a3821f293908d9ea6d3fcfc6d485e65745d48e8afbac5
4
+ data.tar.gz: 1f2ced91682b5960624b0bf30c3c9e109dae657c578a6b072a3eefe5610c11cb
5
5
  SHA512:
6
- metadata.gz: e39cfa57ff12e5df3011e729627c37948b658c8c82447398c1547b94486b0ef46cd0b4f6491e598375010c3882ca23a2fa5288d407cddaebc88d74996712f9e7
7
- data.tar.gz: 1a680465ce5f430100b01ec9b2fdc68f51813b280b03d886454f8c0c61d7cafee72a7097e53c2cedcf09d2cb399ff56931719978207e648cf6ef9d2401844022
6
+ metadata.gz: 571979757cd7b6d5f0db52019671c4dcffd7b17ea31af9deffe6df01a270c2e7222df5edb27ecb6eca79e7143cc34b2030da01c19cb8a290f18e914819328a8f
7
+ data.tar.gz: ec37c7732ccf1ddacccf0b4bb69a14e82bf20e69b6a1e64df07a5228ab8df3a498e8f2fb507e0eb0c765d9cd8af2faea2c7ede102ff4db6f78c3582eef34523c
@@ -114,7 +114,7 @@ class TextExtractor
114
114
  end
115
115
 
116
116
  def guards(*guard_args)
117
- guard_args = Guards::DEFAULT if guard_args.empty?
117
+ guard_args = Guard::DEFAULT if guard_args.empty?
118
118
  @append_guards = guard_args
119
119
  end
120
120
 
@@ -5,37 +5,37 @@ class TextExtractor
5
5
  def initialize(_regexp, description:, **kwargs)
6
6
  super
7
7
  @description = description
8
- @factory ||= :itself.to_proc
9
8
  end
10
9
 
11
10
  def extraction(match, _fill)
12
- text = @factory.call(match[0])
11
+ text = match[0]
12
+ text = @factory.call(text) if @factory
13
13
  raise GuardError, "#{@description} near #{text.inspect}"
14
14
  end
15
- end
16
15
 
17
- INDENTED = {
18
- description: 'indented line',
19
- block: proc {
20
- /
21
- ^[^\n\S]+[^\n]*$
22
- /
23
- }
24
- }.freeze
16
+ INDENTED = {
17
+ description: 'indented line',
18
+ block: proc {
19
+ /
20
+ ^[^\n\S]+[^\n]*$
21
+ /
22
+ }
23
+ }.freeze
25
24
 
26
- UNINDENTED = {
27
- description: 'unindented line',
28
- block: proc {
29
- /
30
- ^\S+[^\n]*$
31
- /
32
- }
33
- }.freeze
25
+ UNINDENTED = {
26
+ description: 'unindented line',
27
+ block: proc {
28
+ /
29
+ ^\S+[^\n]*$
30
+ /
31
+ }
32
+ }.freeze
34
33
 
35
- DEFAULT = [
36
- INDENTED,
37
- UNINDENTED
38
- ].freeze
34
+ DEFAULT = [
35
+ INDENTED,
36
+ UNINDENTED
37
+ ].freeze
38
+ end
39
39
 
40
40
  class GuardError < StandardError; end
41
41
  end # class TextExtractor
@@ -1,5 +1,5 @@
1
1
  class TextExtractor
2
2
  def self.version
3
- '0.5.0'
3
+ '0.5.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: text_extractor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Miller