slither 0.99.6 → 0.99.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 +4 -4
- data/Gemfile +2 -2
- data/Gemfile.lock +30 -27
- data/Rakefile +1 -1
- data/lib/slither/version.rb +1 -1
- data/lib/slither.rb +16 -16
- 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: 8b051e82db86d3c7b5e19f807d932b639be6d9a63f90cdd7a8eb3ea4b2a5bdad
|
4
|
+
data.tar.gz: f4888aa4cadca12afe03740ff902218d75c39bec16f2e542182e7eb85b6580ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3f1b0e492b6a39e89cfe2a0db34b649fda0794f744c212fcba1d0b4d40e8a5e830342db67ff9285b5b526ece0e2aaa1f2833218c999acd0f5c57e0b69e18dab
|
7
|
+
data.tar.gz: af9d062e3c0a4653cd1670f4e07fd85533c5dba52ad127062a8e2b5ea09f4bff742aed87f12369b70a536a041fb4ef235fec28ea96a5d2ab16750ca35008ca6e
|
data/Gemfile
CHANGED
@@ -9,7 +9,7 @@ gem "bundler"
|
|
9
9
|
gem "pry"
|
10
10
|
gem "rake", "~> 13.0"
|
11
11
|
gem "rspec", "~> 3.0"
|
12
|
-
gem "rubocop", "~> 1.
|
13
|
-
gem "rubocop-rspec", "~>
|
12
|
+
gem "rubocop", "~> 1.76.1"
|
13
|
+
gem "rubocop-rspec", "~> 3.6.0", require: false
|
14
14
|
# Documentation tool
|
15
15
|
gem "yard"
|
data/Gemfile.lock
CHANGED
@@ -1,26 +1,30 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
slither (0.99.
|
4
|
+
slither (0.99.7)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
ast (2.4.
|
9
|
+
ast (2.4.3)
|
10
10
|
coderay (1.1.3)
|
11
11
|
diff-lcs (1.5.0)
|
12
|
-
json (2.
|
12
|
+
json (2.12.2)
|
13
|
+
language_server-protocol (3.17.0.5)
|
14
|
+
lint_roller (1.1.0)
|
13
15
|
method_source (1.0.0)
|
14
|
-
parallel (1.
|
15
|
-
parser (3.
|
16
|
+
parallel (1.27.0)
|
17
|
+
parser (3.3.8.0)
|
16
18
|
ast (~> 2.4.1)
|
19
|
+
racc
|
20
|
+
prism (1.4.0)
|
17
21
|
pry (0.14.2)
|
18
22
|
coderay (~> 1.1)
|
19
23
|
method_source (~> 1.0)
|
24
|
+
racc (1.8.1)
|
20
25
|
rainbow (3.1.1)
|
21
26
|
rake (13.0.6)
|
22
|
-
regexp_parser (2.
|
23
|
-
rexml (3.2.5)
|
27
|
+
regexp_parser (2.10.0)
|
24
28
|
rspec (3.12.0)
|
25
29
|
rspec-core (~> 3.12.0)
|
26
30
|
rspec-expectations (~> 3.12.0)
|
@@ -34,28 +38,27 @@ GEM
|
|
34
38
|
diff-lcs (>= 1.2.0, < 2.0)
|
35
39
|
rspec-support (~> 3.12.0)
|
36
40
|
rspec-support (3.12.0)
|
37
|
-
rubocop (1.
|
41
|
+
rubocop (1.76.1)
|
38
42
|
json (~> 2.3)
|
43
|
+
language_server-protocol (~> 3.17.0.2)
|
44
|
+
lint_roller (~> 1.1.0)
|
39
45
|
parallel (~> 1.10)
|
40
|
-
parser (>= 3.
|
46
|
+
parser (>= 3.3.0.2)
|
41
47
|
rainbow (>= 2.2.2, < 4.0)
|
42
|
-
regexp_parser (>=
|
43
|
-
|
44
|
-
rubocop-ast (>= 1.24.1, < 2.0)
|
48
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
49
|
+
rubocop-ast (>= 1.45.0, < 2.0)
|
45
50
|
ruby-progressbar (~> 1.7)
|
46
|
-
unicode-display_width (>= 2.4.0, <
|
47
|
-
rubocop-ast (1.
|
48
|
-
parser (>= 3.
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
rubocop (~> 1.
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
ruby-progressbar (1.11.0)
|
58
|
-
unicode-display_width (2.4.2)
|
51
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
52
|
+
rubocop-ast (1.45.1)
|
53
|
+
parser (>= 3.3.7.2)
|
54
|
+
prism (~> 1.4)
|
55
|
+
rubocop-rspec (3.6.0)
|
56
|
+
lint_roller (~> 1.1)
|
57
|
+
rubocop (~> 1.72, >= 1.72.1)
|
58
|
+
ruby-progressbar (1.13.0)
|
59
|
+
unicode-display_width (3.1.4)
|
60
|
+
unicode-emoji (~> 4.0, >= 4.0.4)
|
61
|
+
unicode-emoji (4.0.4)
|
59
62
|
yard (0.9.34)
|
60
63
|
|
61
64
|
PLATFORMS
|
@@ -66,8 +69,8 @@ DEPENDENCIES
|
|
66
69
|
pry
|
67
70
|
rake (~> 13.0)
|
68
71
|
rspec (~> 3.0)
|
69
|
-
rubocop (~> 1.
|
70
|
-
rubocop-rspec (~>
|
72
|
+
rubocop (~> 1.76.1)
|
73
|
+
rubocop-rspec (~> 3.6.0)
|
71
74
|
slither!
|
72
75
|
yard
|
73
76
|
|
data/Rakefile
CHANGED
data/lib/slither/version.rb
CHANGED
data/lib/slither.rb
CHANGED
@@ -17,6 +17,18 @@ module Slither
|
|
17
17
|
class LineWrongSizeError < StandardError; end
|
18
18
|
class SectionsNotSameLengthError < StandardError; end
|
19
19
|
|
20
|
+
class << self
|
21
|
+
private
|
22
|
+
|
23
|
+
def definitions
|
24
|
+
@@definitions ||= {} # rubocop:disable Style/ClassVars
|
25
|
+
end
|
26
|
+
|
27
|
+
def definition(name)
|
28
|
+
definitions[name]
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
20
32
|
# Define a Slither's definition to parse a file.
|
21
33
|
#
|
22
34
|
# name - String name of the definition, this should be unique.
|
@@ -24,7 +36,7 @@ module Slither
|
|
24
36
|
# Ex: by_bytes: true, to parse by bytes
|
25
37
|
# Ex: align: :left, to align the columns to the left
|
26
38
|
# block - Block to define the sections of the definition. See README.md for more info.
|
27
|
-
def self.define(name, options = {}, &block)
|
39
|
+
def self.define(name, options = {}, &block) # rubocop:disable Lint/UnusedMethodArgument
|
28
40
|
definition = Definition.new(options)
|
29
41
|
yield(definition)
|
30
42
|
definitions[name] = definition
|
@@ -42,33 +54,21 @@ module Slither
|
|
42
54
|
|
43
55
|
# Writes the File
|
44
56
|
def self.write(filename, definition_name, data)
|
45
|
-
File.
|
46
|
-
f.write generate(definition_name, data)
|
47
|
-
end
|
57
|
+
File.write(filename, generate(definition_name, data))
|
48
58
|
end
|
49
59
|
|
50
60
|
def self.parse(filename, definition_name)
|
51
61
|
raise ArgumentError, "File #{filename} does not exist." unless File.exist?(filename)
|
52
62
|
|
53
|
-
file_io = File.open(filename,
|
63
|
+
file_io = File.open(filename, "r")
|
54
64
|
parseIo(file_io, definition_name)
|
55
65
|
end
|
56
66
|
|
57
|
-
def self.parseIo(io, definition_name)
|
67
|
+
def self.parseIo(io, definition_name) # rubocop:disable Naming/MethodName
|
58
68
|
definition = definition(definition_name)
|
59
69
|
raise ArgumentError, "Definition name '#{definition_name}' was not found." unless definition
|
60
70
|
|
61
71
|
parser = Parser.new(definition, io)
|
62
72
|
definition.options[:by_bytes] ? parser.parse_by_bytes : parser.parse
|
63
73
|
end
|
64
|
-
|
65
|
-
private
|
66
|
-
|
67
|
-
def self.definitions
|
68
|
-
@@definitions ||= {}
|
69
|
-
end
|
70
|
-
|
71
|
-
def self.definition(name)
|
72
|
-
definitions[name]
|
73
|
-
end
|
74
74
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slither
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.99.
|
4
|
+
version: 0.99.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Wood
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-06-18 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|
@@ -47,14 +47,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
47
47
|
requirements:
|
48
48
|
- - ">="
|
49
49
|
- !ruby/object:Gem::Version
|
50
|
-
version: 3.
|
50
|
+
version: 3.2.0
|
51
51
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
53
|
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '0'
|
56
56
|
requirements: []
|
57
|
-
rubygems_version: 3.
|
57
|
+
rubygems_version: 3.4.10
|
58
58
|
signing_key:
|
59
59
|
specification_version: 4
|
60
60
|
summary: A simple, clean DSL for describing, writing, and parsing fixed-width text
|