Class: Insika::Doctor::DomainReport
- Inherits:
-
Data
- Object
- Data
- Insika::Doctor::DomainReport
- Defined in:
- lib/insika/doctor.rb
Overview
The domain section of the doctor: the E2 proof surface. Read-only and informational — it never fails the exit code (a pilot reporting its own artifacts exits 0).
Instance Attribute Summary collapse
-
#entries ⇒ Object
readonly
Returns the value of attribute entries.
-
#gem_version ⇒ Object
readonly
Returns the value of attribute gem_version.
-
#generated_at ⇒ Object
readonly
Returns the value of attribute generated_at.
Instance Method Summary collapse
- #count ⇒ Object
- #empty? ⇒ Boolean
- #to_h ⇒ Object
-
#to_s ⇒ Object
The human section (prints AFTER the findings — a section, not a finding).
Instance Attribute Details
#entries ⇒ Object (readonly)
Returns the value of attribute entries
74 75 76 |
# File 'lib/insika/doctor.rb', line 74 def entries @entries end |
#gem_version ⇒ Object (readonly)
Returns the value of attribute gem_version
74 75 76 |
# File 'lib/insika/doctor.rb', line 74 def gem_version @gem_version end |
#generated_at ⇒ Object (readonly)
Returns the value of attribute generated_at
74 75 76 |
# File 'lib/insika/doctor.rb', line 74 def generated_at @generated_at end |
Instance Method Details
#count ⇒ Object
76 |
# File 'lib/insika/doctor.rb', line 76 def count = entries.length |
#empty? ⇒ Boolean
75 |
# File 'lib/insika/doctor.rb', line 75 def empty? = entries.empty? |
#to_h ⇒ Object
78 79 80 81 |
# File 'lib/insika/doctor.rb', line 78 def to_h { "generated_at" => generated_at, "gem_version" => gem_version, "count" => count, "entries" => entries.map(&:to_h) } end |
#to_s ⇒ Object
The human section (prints AFTER the findings — a section, not a finding).
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/insika/doctor.rb', line 84 def to_s header = if count.zero? "domain: 0 artifacts — a bare install declares no store and ships no corpus in use" else "domain: #{count} artifact(s) — declared by the deployment or inherited from the gem default" end lines = entries.map do |e| agent = e.agent ? "#{e.agent}: " : "" source = e.source ? " (#{e.source})" : "" clear = e.how_to_clear ? " — clear: #{e.how_to_clear}" : "" " [#{e.kind}] #{agent}#{e.detail}#{source}#{clear}" end ([header] + lines).join("\n") end |