fbtok 0.3.1 → 0.3.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 +1 -1
- data/bin/fbtok +11 -4
- data/bin/fbtree +11 -4
- data/lib/fbtok/linter.rb +6 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 15089da91cb8cb9ce5f6905c3714e52758fcf4254c26f978ef1a64ac053caf9d
|
4
|
+
data.tar.gz: 13edb307d1fcbc9b0e30ff80f1764623c5f4a1cc17ef225e61d96e071615bcc6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d56318a4f9895dd71b8c6309ba131e2a310e0bc5d799bfe646f67220138ca1351bbde05ee5725bd28676988ccdbca009f0868b8de6f0e9a2ea5923743a2a32f
|
7
|
+
data.tar.gz: a28531c219b2ccf4cd1ee76129dcb8564433b1b3c2bdd1fd439ab44a4be2d04541cb8436cc9daab15c3010b22f590179556acfed1a2d2c8b23243f5156220e01
|
data/CHANGELOG.md
CHANGED
data/Rakefile
CHANGED
data/bin/fbtok
CHANGED
@@ -10,6 +10,7 @@ args = ARGV
|
|
10
10
|
|
11
11
|
opts = {
|
12
12
|
debug: true,
|
13
|
+
warn: false,
|
13
14
|
file: nil,
|
14
15
|
}
|
15
16
|
|
@@ -18,13 +19,17 @@ parser = OptionParser.new do |parser|
|
|
18
19
|
|
19
20
|
|
20
21
|
parser.on( "-q", "--quiet",
|
21
|
-
"less debug output/messages
|
22
|
+
"less debug output/messages (default: #{!opts[:debug]})" ) do |debug|
|
22
23
|
opts[:debug] = false
|
23
24
|
end
|
24
25
|
parser.on( "--verbose", "--debug",
|
25
26
|
"turn on verbose / debug output (default: #{opts[:debug]})" ) do |debug|
|
26
27
|
opts[:debug] = true
|
27
28
|
end
|
29
|
+
parser.on( "-w", "--warn",
|
30
|
+
"turn warnings into errors (default: #{opts[:warn]})" ) do |warn|
|
31
|
+
opts[:warn] = true
|
32
|
+
end
|
28
33
|
|
29
34
|
=begin
|
30
35
|
parser.on( "--metal",
|
@@ -51,11 +56,13 @@ if opts[:debug]
|
|
51
56
|
p opts
|
52
57
|
puts "ARGV:"
|
53
58
|
p args
|
54
|
-
|
55
|
-
SportDb::Parser::Linter.debug = true
|
56
|
-
SportDb::Parser::Opts.debug = true
|
57
59
|
end
|
58
60
|
|
61
|
+
SportDb::Parser::Linter.debug = opts[:debug]
|
62
|
+
SportDb::Parser::Opts.debug = opts[:debug]
|
63
|
+
|
64
|
+
SportDb::Parser::Linter.warn = opts[:warn]
|
65
|
+
|
59
66
|
|
60
67
|
|
61
68
|
## todo/check - use packs or projects or such
|
data/bin/fbtree
CHANGED
@@ -10,6 +10,7 @@ args = ARGV
|
|
10
10
|
|
11
11
|
opts = {
|
12
12
|
debug: true,
|
13
|
+
warn: false,
|
13
14
|
file: nil,
|
14
15
|
}
|
15
16
|
|
@@ -18,13 +19,18 @@ parser = OptionParser.new do |parser|
|
|
18
19
|
|
19
20
|
|
20
21
|
parser.on( "-q", "--quiet",
|
21
|
-
"less debug output/messages
|
22
|
+
"less debug output/messages (default: #{!opts[:debug]})" ) do |debug|
|
22
23
|
opts[:debug] = false
|
23
24
|
end
|
24
25
|
parser.on( "--verbose", "--debug",
|
25
26
|
"turn on verbose / debug output (default: #{opts[:debug]})" ) do |debug|
|
26
27
|
opts[:debug] = true
|
27
28
|
end
|
29
|
+
parser.on( "-w", "--warn",
|
30
|
+
"turn warnings into errors (default: #{opts[:warn]})" ) do |warn|
|
31
|
+
opts[:warn] = true
|
32
|
+
end
|
33
|
+
|
28
34
|
|
29
35
|
parser.on( "-f FILE", "--file FILE",
|
30
36
|
"read datafiles (pathspecs) via .csv file") do |file|
|
@@ -42,11 +48,12 @@ if opts[:debug]
|
|
42
48
|
p opts
|
43
49
|
puts "ARGV:"
|
44
50
|
p args
|
45
|
-
|
46
|
-
SportDb::Parser::Linter.debug = true
|
47
|
-
SportDb::Parser::Opts.debug = true
|
48
51
|
end
|
49
52
|
|
53
|
+
SportDb::Parser::Linter.debug = opts[:debug]
|
54
|
+
SportDb::Parser::Opts.debug = opts[:debug]
|
55
|
+
|
56
|
+
SportDb::Parser::Linter.warn = opts[:warn]
|
50
57
|
|
51
58
|
|
52
59
|
|
data/lib/fbtok/linter.rb
CHANGED
@@ -10,6 +10,10 @@ def self.debug=(value) @@debug = value; end
|
|
10
10
|
def self.debug?() @@debug ||= false; end ## note: default is FALSE
|
11
11
|
def debug?() self.class.debug?; end
|
12
12
|
|
13
|
+
## turn warn(ings) into errors (default is false)
|
14
|
+
def self.warn=(value) @@warn = value; end
|
15
|
+
def self.warn?() @@warn ||= false; end ## note: default is FALSE
|
16
|
+
def warn?() self.class.warn?; end
|
13
17
|
|
14
18
|
|
15
19
|
attr_reader :errors
|
@@ -101,7 +105,8 @@ def read( path, parse: true )
|
|
101
105
|
|
102
106
|
##
|
103
107
|
## auto-add error if no tokens/tree nodes
|
104
|
-
|
108
|
+
## note - do NOT report empty file error by default
|
109
|
+
if @tree.empty? && warn? ## @tree.size == 0
|
105
110
|
@errors << [path, "empty; no #{parse ? 'parse tree nodes' : 'tokens'}"]
|
106
111
|
end
|
107
112
|
|
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.3.
|
4
|
+
version: 0.3.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-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sportdb-parser
|