text_extractor 0.1.6 → 0.1.7

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: 5c189f0b5ec9e1038d1861be7917451115f06980
4
- data.tar.gz: 2817759a04f289b9aea17e559591420f69d74bd2
3
+ metadata.gz: e956aff10058c42b11f0cab0fd26f4218e6fcaa9
4
+ data.tar.gz: 0f947396657eb89749366e3c84ccb08899e07d19
5
5
  SHA512:
6
- metadata.gz: 6ff6af6d8e7158e3ee1301e00190ce6865d2d9783510374e0252393837597f4a95dfdee2f5f9b58e634f88753d789ea69d866aa018fd46e2520946c20ba02c98
7
- data.tar.gz: 280b8271a4c6b99afd426324fc463c55366d658014bd2e07137ea34ff0511462e5fd687abd435822f667f56dad44fa1acc914162e4ab2e282e446ad88e20d3f7
6
+ metadata.gz: e9b3e596e799952397dd8ae76c2deb52c84d356f468f1788f6c173cb9df4a77683ac279780900ed45dc49a729baba422288073ddac4c67349b93070bebd7140d
7
+ data.tar.gz: ed8e0f2321f97843748e7d980b2e15e97fe651c2a80409f8daaa049786a426c3321eb77791e3ecb641d570c0e9dc7ae9673a2ea25086e7b513323597e4e519c4
@@ -44,7 +44,8 @@ class TextExtractor
44
44
  'begin' => { class: Begin, arguments: :parsed },
45
45
  'end' => { class: End },
46
46
  'maybe' => { class: Maybe },
47
- 'repeat' => { class: Repeat, arguments: :parse }
47
+ 'repeat' => { class: Repeat, arguments: :parse },
48
+ 'rest' => { class: Rest }
48
49
  }.freeze
49
50
  private_constant :DIRECTIVE_MAP
50
51
 
@@ -69,5 +69,12 @@ class TextExtractor
69
69
  state.current = ['(?:', state.current, "){#{@argument}}"]
70
70
  end
71
71
  end
72
+
73
+ # skip to end of line
74
+ class Rest < Directive
75
+ def call
76
+ state.current = [state.current, '[^\\n]*']
77
+ end
78
+ end
72
79
  end
73
80
  end
@@ -1,5 +1,5 @@
1
1
  class TextExtractor
2
2
  def self.version
3
- '0.1.6'
3
+ '0.1.7'
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.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Miller