Class: Rigor::SignaturePathAudit::Entry
- Inherits:
-
Data
- Object
- Data
- Rigor::SignaturePathAudit::Entry
- Defined in:
- lib/rigor/signature_path_audit.rb
Overview
One configured ‘signature_paths:` entry’s resolution status.
‘status` is one of:
-
‘:ok` — a directory containing at least one `.rbs`.
-
‘:missing` — the path does not exist.
-
‘:not_directory` — the path exists but is not a directory (the loader only `add`s directories, so a `.rbs` file passed directly is silently ignored).
-
‘:empty` — a directory with no `.rbs` file (recursive).
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#rbs_file_count ⇒ Object
readonly
Returns the value of attribute rbs_file_count.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#message ⇒ Object
One-line, human-facing reason.
- #ok? ⇒ Boolean
- #to_h ⇒ Object
- #warning? ⇒ Boolean
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path
32 33 34 |
# File 'lib/rigor/signature_path_audit.rb', line 32 def path @path end |
#rbs_file_count ⇒ Object (readonly)
Returns the value of attribute rbs_file_count
32 33 34 |
# File 'lib/rigor/signature_path_audit.rb', line 32 def rbs_file_count @rbs_file_count end |
#status ⇒ Object (readonly)
Returns the value of attribute status
32 33 34 |
# File 'lib/rigor/signature_path_audit.rb', line 32 def status @status end |
Instance Method Details
#message ⇒ Object
One-line, human-facing reason. The wording matches the loader’s actual behaviour (“loaded nothing from it”) rather than the filesystem error, so the message points at the consequence.
44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/rigor/signature_path_audit.rb', line 44 def case status when :missing "signature_paths: #{path.inspect} does not exist (no signatures loaded from it)" when :not_directory "signature_paths: #{path.inspect} is not a directory (no signatures loaded from it)" when :empty "signature_paths: #{path.inspect} matched 0 signature files" else "signature_paths: #{path.inspect} loaded #{rbs_file_count} signature file(s)" end end |
#ok? ⇒ Boolean
33 34 35 |
# File 'lib/rigor/signature_path_audit.rb', line 33 def ok? status == :ok end |
#to_h ⇒ Object
57 58 59 |
# File 'lib/rigor/signature_path_audit.rb', line 57 def to_h { "path" => path, "status" => status.to_s, "rbs_file_count" => rbs_file_count, "message" => } end |
#warning? ⇒ Boolean
37 38 39 |
# File 'lib/rigor/signature_path_audit.rb', line 37 def warning? !ok? end |