text_extractor 0.1.8 → 0.2.0

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
  SHA1:
3
- metadata.gz: 33c60b21e8e025e62025f06af668dd4859cde35c
4
- data.tar.gz: 3c3b0c21fc91326431f95d323daedc84f580ed53
3
+ metadata.gz: 78291099c84221f93ff6068099d736bc6703579b
4
+ data.tar.gz: 8a65b9164e395200fac46207b6b313dfa8084a2b
5
5
  SHA512:
6
- metadata.gz: b6e4d910641926e734e9c0cc22d486e15ac695c549ca1eb09c1e78621caa49e6e535533becb83dcd3f2ad93b81954cfc8efa74ade21f4b618a6f56ffe74ed978
7
- data.tar.gz: 2ecc4bfd0e9e123e46254dbe264d5a102593a48a1668f9a0d41f7d66b22266925b58b21cf57c138121f4ece8559be3151ca33de6eb5905f965def79cbae096c6
6
+ metadata.gz: 7b18d39bde364c3417ccd18ff4ce8f072568e3e63b838b1bdce46b25cffd6b7356dbf2f4e9b1f6fd816368ce0aa194a1e6cc9f4ccd584f579a85eb795b264ddd
7
+ data.tar.gz: a99721d0d2a48b5364dd301415334fdd85563664144d3d4a216c70d2c39ecd7654b64b9e49c78f582bb762c4dae8d33abc809b45807328f35b010fc3aff31482
@@ -2,9 +2,19 @@ require_relative 'record'
2
2
 
3
3
  class TextExtractor
4
4
  class Filldown < Record
5
+ def initialize(*args, **kwargs)
6
+ @filldown_output = kwargs.delete(:output) || false
7
+ super(*args, **kwargs)
8
+ end
9
+
5
10
  def extraction(match, fill)
6
11
  fill.merge!(extract_values(match))
7
- []
12
+
13
+ if @filldown_output
14
+ super
15
+ else
16
+ []
17
+ end
8
18
  end
9
19
  end # class Filldown < Record
10
20
  end # class TextExtractor
@@ -9,7 +9,11 @@ class TextExtractor
9
9
  end
10
10
 
11
11
  def convert(value)
12
- @block ? @block.call(*value) : value
12
+ @block ? @block.call(value) : value
13
+ rescue => e
14
+ raise e.class,
15
+ "in custom conversion of "\
16
+ "value(#{id.inspect}, #{re.inspect}): #{e.message}"
13
17
  end
14
18
  end
15
19
  end
@@ -1,5 +1,5 @@
1
1
  class TextExtractor
2
2
  def self.version
3
- '0.1.8'
3
+ '0.2.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: text_extractor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Miller
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-23 00:00:00.000000000 Z
11
+ date: 2016-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler