Module: Ibex::VerificationReport::LogicalPath
- Defined in:
- lib/ibex/verification_report/logical_path.rb,
sig/ibex/verification_report/logical_path.rbs
Overview
Closed logical identities used by version 1 verification reports.
Constant Summary collapse
- MAX_INPUT_FILES =
10_000- BASENAME =
%r{\A(?!\.{1,2}\z)[^/\\\x00-\x1f\x7f]+\z}- INPUT =
%r{\Ainput/(?<index>[0-9]{4})/(?<basename>[^/\\\x00-\x1f\x7f]+)\z}- TABLE =
%r{\Atable/(?<basename>[^/\\\x00-\x1f\x7f]+)\z}
Class Method Summary collapse
- .canonical_input?(value, index) ⇒ Boolean
- .canonical_table?(value) ⇒ Boolean
- .input(path, index) ⇒ Object
- .table(path) ⇒ Object
Instance Method Summary collapse
- #self?.basename ⇒ String
- #self?.canonical_input? ⇒ Boolean
- #self?.canonical_table? ⇒ Boolean
- #self?.input ⇒ String
- #self?.table ⇒ String
- #self?.usable_basename? ⇒ Boolean
Class Method Details
.canonical_input?(value, index) ⇒ Boolean
30 31 32 33 34 35 36 37 38 |
# File 'lib/ibex/verification_report/logical_path.rb', line 30 def canonical_input?(value, index) return false unless value.is_a?(String) match = INPUT.match(value) return false unless match basename = match[:basename] !!(basename && match[:index] == format("%04d", index) && usable_basename?(basename)) end |
.canonical_table?(value) ⇒ Boolean
41 42 43 44 45 46 47 48 49 |
# File 'lib/ibex/verification_report/logical_path.rb', line 41 def canonical_table?(value) return false unless value.is_a?(String) match = TABLE.match(value) return false unless match basename = match[:basename] !!(basename && usable_basename?(basename)) end |
.input(path, index) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/ibex/verification_report/logical_path.rb', line 16 def input(path, index) unless index.is_a?(Integer) && index.between?(0, MAX_INPUT_FILES - 1) raise ArgumentError, "verification reports support at most #{MAX_INPUT_FILES} input files" end "input/#{format('%04d', index)}/#{basename(path)}" end |
.table(path) ⇒ Object
25 26 27 |
# File 'lib/ibex/verification_report/logical_path.rb', line 25 def table(path) "table/#{basename(path)}" end |
Instance Method Details
#self?.basename ⇒ String
28 |
# File 'sig/ibex/verification_report/logical_path.rbs', line 28
def self?.basename: (String path) -> String
|
#self?.canonical_input? ⇒ Boolean
22 |
# File 'sig/ibex/verification_report/logical_path.rbs', line 22
def self?.canonical_input?: (Object? value, Integer index) -> bool
|
#self?.canonical_table? ⇒ Boolean
25 |
# File 'sig/ibex/verification_report/logical_path.rbs', line 25
def self?.canonical_table?: (Object? value) -> bool
|
#self?.input ⇒ String
16 |
# File 'sig/ibex/verification_report/logical_path.rbs', line 16
def self?.input: (String path, Integer index) -> String
|
#self?.table ⇒ String
19 |
# File 'sig/ibex/verification_report/logical_path.rbs', line 19
def self?.table: (String path) -> String
|
#self?.usable_basename? ⇒ Boolean
31 |
# File 'sig/ibex/verification_report/logical_path.rbs', line 31
def self?.usable_basename?: (String value) -> bool
|