Class: RepoTender::UI::NullReporter
- Inherits:
-
Object
- Object
- RepoTender::UI::NullReporter
- Defined in:
- lib/repo_tender/ui/reporter.rb
Overview
The reporter event interface. Every implementation must respond to:
attach(task) # spawn render-loop fiber as child of task
# called BEFORE listing begins; no total yet
listing_started(total:) # N orgs about to be listed
org_listed(ref, count:) # one per org as it finishes listing;
# ref is OrgRef; count: nil on failure
listing_finished # all orgs listed (or skipped on auth failure)
run_started(total:) # N repos about to be processed
repo_started(ref) # work begins on ref ("host/owner/name" string)
repo_phase(ref, phase) # :cloning | :fast_forwarding | :switching
repo_finished(ref, status, action:, commits: 0)
# final status string (matches state row);
# action: realized-action Symbol; commits: Integer
repo_failed(ref, error) # failure string (plan error or unhandled raise)
run_finished(summary) # Hash<String,Integer> status→count
detach # stop render fiber, restore terminal
Engine event sequence:
attach(task) → listing_started(total:) → {org_listed(ref, count:)} →
listing_finished → run_started(total:) → {repo_started → repo_phase* →
repo_finished|repo_failed} → run_finished(summary) → detach
Implementations:
NullReporter — all no-ops; the engine default
PlainReporter — one ANSI-free line per terminal event
JsonReporter — one JSON object per event line (12-factor)
InteractiveReporter — color + animated progress (two-phase: listing + sweep)
Instance Method Summary collapse
- #attach(task) ⇒ Object
- #detach ⇒ Object
- #listing_finished ⇒ Object
- #listing_started(total:) ⇒ Object
- #org_listed(ref, count:) ⇒ Object
- #repo_failed(ref, error) ⇒ Object
- #repo_finished(ref, status, action:, commits: 0) ⇒ Object
- #repo_phase(ref, phase) ⇒ Object
- #repo_started(ref) ⇒ Object
- #run_finished(summary) ⇒ Object
- #run_started(total:) ⇒ Object
Instance Method Details
#attach(task) ⇒ Object
35 |
# File 'lib/repo_tender/ui/reporter.rb', line 35 def attach(task) = nil |
#detach ⇒ Object
45 |
# File 'lib/repo_tender/ui/reporter.rb', line 45 def detach = nil |
#listing_finished ⇒ Object
38 |
# File 'lib/repo_tender/ui/reporter.rb', line 38 def listing_finished = nil |
#listing_started(total:) ⇒ Object
36 |
# File 'lib/repo_tender/ui/reporter.rb', line 36 def listing_started(total:) = nil |
#org_listed(ref, count:) ⇒ Object
37 |
# File 'lib/repo_tender/ui/reporter.rb', line 37 def org_listed(ref, count:) = nil |
#repo_failed(ref, error) ⇒ Object
43 |
# File 'lib/repo_tender/ui/reporter.rb', line 43 def repo_failed(ref, error) = nil |
#repo_finished(ref, status, action:, commits: 0) ⇒ Object
42 |
# File 'lib/repo_tender/ui/reporter.rb', line 42 def repo_finished(ref, status, action:, commits: 0) = nil |
#repo_phase(ref, phase) ⇒ Object
41 |
# File 'lib/repo_tender/ui/reporter.rb', line 41 def repo_phase(ref, phase) = nil |
#repo_started(ref) ⇒ Object
40 |
# File 'lib/repo_tender/ui/reporter.rb', line 40 def repo_started(ref) = nil |
#run_finished(summary) ⇒ Object
44 |
# File 'lib/repo_tender/ui/reporter.rb', line 44 def run_finished(summary) = nil |
#run_started(total:) ⇒ Object
39 |
# File 'lib/repo_tender/ui/reporter.rb', line 39 def run_started(total:) = nil |