fbtok 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -1
- data/Rakefile +2 -2
- data/lib/fbtok/linter.rb +7 -40
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a0ce828e29e589e804a281a71a1c1160951b669a6fecd82cc42dc9bebf059dd1
|
4
|
+
data.tar.gz: 42bcc2682928350e3dc4344ea245e1a5da2156743eb3917a293b963ed93123c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c1dd2f87074bf4d2c063df0032b5068d8c023f190a090492a964d210f7a0eae20e3239a61bc387e1f6f0313a8dc316ff5cd62971b383cbe8690f11f1199e117
|
7
|
+
data.tar.gz: 3020d52799befbda3d2d45a8f2d830e1fcb4e5b8330652fa04b0e46563d9b979b8ba63c82756519d64e1db144d421f70cb78949865f1c3c0d7aaba017b6c57ab
|
data/CHANGELOG.md
CHANGED
data/Rakefile
CHANGED
@@ -2,7 +2,7 @@ require 'hoe'
|
|
2
2
|
|
3
3
|
|
4
4
|
Hoe.spec 'fbtok' do
|
5
|
-
self.version = '0.2.
|
5
|
+
self.version = '0.2.2'
|
6
6
|
|
7
7
|
self.summary = "fbtok - football.txt lint tools incl. tokenizer, parser & more"
|
8
8
|
self.description = summary
|
@@ -21,7 +21,7 @@ Hoe.spec 'fbtok' do
|
|
21
21
|
self.extra_deps = [
|
22
22
|
# ['sportdb-structs', '>= 0.5.0'],
|
23
23
|
# ['logutils', '>= 0.6.1'],
|
24
|
-
['sportdb-parser', '>= 0.5.
|
24
|
+
['sportdb-parser', '>= 0.5.4'],
|
25
25
|
['sportdb-formats', '>= 2.1.2'],
|
26
26
|
]
|
27
27
|
|
data/lib/fbtok/linter.rb
CHANGED
@@ -30,39 +30,9 @@ def read( path, parse: true )
|
|
30
30
|
## note: every (new) read call - resets errors list to empty
|
31
31
|
@errors = []
|
32
32
|
|
33
|
-
|
33
|
+
outline = QuickMatchOutline.read( path )
|
34
34
|
|
35
|
-
|
36
|
-
h1 = nil
|
37
|
-
h2 = nil
|
38
|
-
orphans = 0 ## track paragraphs's with no heading
|
39
|
-
|
40
|
-
|
41
|
-
nodes.each do |node|
|
42
|
-
type = node[0]
|
43
|
-
|
44
|
-
if type == :h1
|
45
|
-
h1 = node[1] ## get heading text
|
46
|
-
puts " = Heading 1 >#{node[1]}<"
|
47
|
-
elsif type == :h2
|
48
|
-
if h1.nil?
|
49
|
-
puts "!! WARN - no heading for subheading; skipping parse"
|
50
|
-
next
|
51
|
-
end
|
52
|
-
h2 = node[1] ## get heading text
|
53
|
-
puts " == Heading 2 >#{node[1]}<"
|
54
|
-
elsif type == :p
|
55
|
-
|
56
|
-
if h1.nil?
|
57
|
-
orphans += 1 ## only warn once
|
58
|
-
puts "!! WARN - no heading for #{orphans} text paragraph(s); skipping parse"
|
59
|
-
next
|
60
|
-
end
|
61
|
-
|
62
|
-
lines = node[1]
|
63
|
-
|
64
|
-
|
65
|
-
tree = []
|
35
|
+
outline.each_para do |lines|
|
66
36
|
|
67
37
|
if parse
|
68
38
|
## flatten lines
|
@@ -84,6 +54,7 @@ def read( path, parse: true )
|
|
84
54
|
pp tree
|
85
55
|
|
86
56
|
else ## process for tokenize only
|
57
|
+
tree = []
|
87
58
|
lines.each_with_index do |line,i|
|
88
59
|
|
89
60
|
if debug?
|
@@ -127,14 +98,10 @@ def read( path, parse: true )
|
|
127
98
|
pp t if debug?
|
128
99
|
|
129
100
|
tree << t
|
130
|
-
end
|
131
|
-
end
|
132
|
-
|
133
|
-
|
134
|
-
raise ArgumentError, "unsupported (node) type >#{type}<"
|
135
|
-
end
|
136
|
-
end # each node
|
137
|
-
end # read
|
101
|
+
end # each line
|
102
|
+
end # parse? (or tokenize?)
|
103
|
+
end # each para (node)
|
104
|
+
end # method read
|
138
105
|
end # class Linter
|
139
106
|
|
140
107
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fbtok
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gerald Bauer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-01-
|
11
|
+
date: 2025-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sportdb-parser
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.5.
|
19
|
+
version: 0.5.4
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.5.
|
26
|
+
version: 0.5.4
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: sportdb-formats
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|