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 onlyadds directories, so a.rbsfile passed directly is silently ignored).:empty— a directory with no.rbsfile (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
28 29 30 |
# File 'lib/rigor/signature_path_audit.rb', line 28 def path @path end |
#rbs_file_count ⇒ Object (readonly)
Returns the value of attribute rbs_file_count
28 29 30 |
# File 'lib/rigor/signature_path_audit.rb', line 28 def rbs_file_count @rbs_file_count end |
#status ⇒ Object (readonly)
Returns the value of attribute status
28 29 30 |
# File 'lib/rigor/signature_path_audit.rb', line 28 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.
40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/rigor/signature_path_audit.rb', line 40 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
29 30 31 |
# File 'lib/rigor/signature_path_audit.rb', line 29 def ok? status == :ok end |
#to_h ⇒ Object
53 54 55 |
# File 'lib/rigor/signature_path_audit.rb', line 53 def to_h { "path" => path, "status" => status.to_s, "rbs_file_count" => rbs_file_count, "message" => } end |
#warning? ⇒ Boolean
33 34 35 |
# File 'lib/rigor/signature_path_audit.rb', line 33 def warning? !ok? end |