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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c719bbab25c068f69c9bd0bc44036ad355c8ca486ea3dfbec6d2276b4d436fbb
4
- data.tar.gz: 7053879da0e31078524b8b74453d5e7f2d3b97b0d503629467210088d91955c5
3
+ metadata.gz: 15089da91cb8cb9ce5f6905c3714e52758fcf4254c26f978ef1a64ac053caf9d
4
+ data.tar.gz: 13edb307d1fcbc9b0e30ff80f1764623c5f4a1cc17ef225e61d96e071615bcc6
5
5
  SHA512:
6
- metadata.gz: 38bd241c9466046377aef3c951de74b25f9a7ae1d38e1827997ba673bea7cb60105344c7f78bd997b8e0e16dc90c89946fe08db39bb3433751e1a55167e55bbf
7
- data.tar.gz: d59f2b6fed95ebb4e7539baf4e841db5ea008b29357438de13bf3094a3062aae7e47d5825d6f7a8299a1684b3295b9c5821806eee890b67fd68dcbb392034a1e
6
+ metadata.gz: 2d56318a4f9895dd71b8c6309ba131e2a310e0bc5d799bfe646f67220138ca1351bbde05ee5725bd28676988ccdbca009f0868b8de6f0e9a2ea5923743a2a32f
7
+ data.tar.gz: a28531c219b2ccf4cd1ee76129dcb8564433b1b3c2bdd1fd439ab44a4be2d04541cb8436cc9daab15c3010b22f590179556acfed1a2d2c8b23243f5156220e01
data/CHANGELOG.md CHANGED
@@ -1,4 +1,4 @@
1
- ### 0.3.1
1
+ ### 0.3.2
2
2
  ### 0.0.1 / 2025-01-02
3
3
 
4
4
  * Everything is new. First release.
data/Rakefile CHANGED
@@ -2,7 +2,7 @@ require 'hoe'
2
2
 
3
3
 
4
4
  Hoe.spec 'fbtok' do
5
- self.version = '0.3.1'
5
+ self.version = '0.3.2'
6
6
 
7
7
  self.summary = "fbtok - football.txt lint tools incl. tokenizer, parser & more"
8
8
  self.description = summary
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 - default is (#{!opts[:debug]})" ) do |debug|
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 - default is (#{!opts[:debug]})" ) do |debug|
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
- if @tree.empty? ## @tree.size == 0
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.1
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-25 00:00:00.000000000 Z
11
+ date: 2025-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sportdb-parser