diabible-parser 0.1.6 → 0.1.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4890da70174e919b49e385c291425fc5c2941230f410107b41aede336ca931ef
4
- data.tar.gz: 5f97266c8dcd64e27a8a208fca5d8239abfd446c91a3a4cf6d12bfa5a83df79c
3
+ metadata.gz: 64811681023b7548280842efde4a24ad3ba7cdcae9619788964fd79d78b6d43c
4
+ data.tar.gz: 3211bd3a8e2363998ca6b97921ee8b5c7be51d40f5a0910bf8e19fc3507f5299
5
5
  SHA512:
6
- metadata.gz: dabfdfaaf2e7a256d9cdc94d29a68973602f9a254a55206dd35cc5ffcd710af27b3b6d0461c119ca4b2cad82cecdce85e01a385c931d9b9bda10ba09ff1d3ede
7
- data.tar.gz: c8545b7ffa872bb1161917be990d0c50297018512c30730e97f039bc920689cd1b9f5d6ec7d62e9b697b132a33bf87ac2185a047592973ee0535aacc26cefb51
6
+ metadata.gz: 23fb01bcdaff782227d18a7b97efb114557845ff4c229ed2a5fd29cd2f91333e01728c0a6815dfe1693120875f88fd835a9a34522d5a417f4f5ec852aaea1274
7
+ data.tar.gz: 7a3cb0557de93b9bdc37e42988b57acc63da3f363ab9087d1f594c9b5bd455af8afe1b4a9108f37a9f30b0aa6b2d5c2d7a13c3ee261579610a7ba7d0cb05ad15
@@ -33,7 +33,7 @@ module Diabible
33
33
  include Helpers::Text
34
34
 
35
35
  # default constructor
36
- def initialize(document, info: true, notes: true, text: true)
36
+ def initialize(document, info: true, notes: true, text: true, limit: 0)
37
37
  Zip::File.open(URI.open(document)) do |zip_file|
38
38
  # open content xml
39
39
  @document = Nokogiri::XML(zip_file.read("word/document.xml"))
@@ -43,6 +43,7 @@ module Diabible
43
43
  # defaults
44
44
  @text = ''
45
45
  @metadata = []
46
+ @limit = 0
46
47
  # parse
47
48
  parse_info if info
48
49
  parse_notes if notes
@@ -62,6 +62,13 @@ module Diabible
62
62
  add_metadata("text", PARAGRAPH, nil, { in: paragraph_in, out: paragraph_out })
63
63
  end
64
64
  end
65
+ # limit check
66
+ if @limit > 0
67
+ if @metadata.size >= @limit
68
+ # when meets limit break
69
+ break
70
+ end
71
+ end
65
72
  end
66
73
  end
67
74
  end
@@ -21,6 +21,6 @@
21
21
 
22
22
  module Diabible
23
23
  module Parser
24
- VERSION = "0.1.6"
24
+ VERSION = "0.1.7"
25
25
  end
26
26
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: diabible-parser
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
  - Michal Mocnak