Class: RepoTender::UI::PlainReporter
- Inherits:
-
Object
- Object
- RepoTender::UI::PlainReporter
- Defined in:
- lib/repo_tender/ui/plain_reporter.rb
Overview
Emits one tab-separated line per terminal repo event, ANSI-free always. repo_finished → “reftstatus”; repo_failed → “reftFAILEDterror”. org_listed → “listed: ref.nametN repos” (or “listed: ref.nametFAILED” on failure). Both write to the same ‘out` stream (G4 choice: no separate stderr stream in Slice A; FAILED marker distinguishes errors).
Instance Method Summary collapse
- #attach(task) ⇒ Object
- #detach ⇒ Object
-
#initialize(out, mode: nil) ⇒ PlainReporter
constructor
A new instance of PlainReporter.
- #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
Constructor Details
#initialize(out, mode: nil) ⇒ PlainReporter
Returns a new instance of PlainReporter.
12 13 14 15 |
# File 'lib/repo_tender/ui/plain_reporter.rb', line 12 def initialize(out, mode: nil) @out = out @out.sync = true end |
Instance Method Details
#attach(task) ⇒ Object
17 |
# File 'lib/repo_tender/ui/plain_reporter.rb', line 17 def attach(task) = nil |
#detach ⇒ Object
18 |
# File 'lib/repo_tender/ui/plain_reporter.rb', line 18 def detach = nil |
#listing_finished ⇒ Object
32 |
# File 'lib/repo_tender/ui/plain_reporter.rb', line 32 def listing_finished = nil |
#listing_started(total:) ⇒ Object
20 21 22 |
# File 'lib/repo_tender/ui/plain_reporter.rb', line 20 def listing_started(total:) @out.puts "listing: #{total} org(s)" end |
#org_listed(ref, count:) ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/repo_tender/ui/plain_reporter.rb', line 24 def org_listed(ref, count:) if count @out.puts "listed: #{ref.name}\t#{count} repo(s)" else @out.puts "listed: #{ref.name}\tFAILED" end end |
#repo_failed(ref, error) ⇒ Object
46 47 48 |
# File 'lib/repo_tender/ui/plain_reporter.rb', line 46 def repo_failed(ref, error) @out.puts "#{ref}\tFAILED\t#{error}" end |
#repo_finished(ref, status, action:, commits: 0) ⇒ Object
42 43 44 |
# File 'lib/repo_tender/ui/plain_reporter.rb', line 42 def repo_finished(ref, status, action:, commits: 0) @out.puts "#{ref}\t#{status}" end |
#repo_phase(ref, phase) ⇒ Object
40 |
# File 'lib/repo_tender/ui/plain_reporter.rb', line 40 def repo_phase(ref, phase) = nil |
#repo_started(ref) ⇒ Object
38 |
# File 'lib/repo_tender/ui/plain_reporter.rb', line 38 def repo_started(ref) = nil |
#run_finished(summary) ⇒ Object
50 |
# File 'lib/repo_tender/ui/plain_reporter.rb', line 50 def run_finished(summary) = nil |
#run_started(total:) ⇒ Object
34 35 36 |
# File 'lib/repo_tender/ui/plain_reporter.rb', line 34 def run_started(total:) @out.puts "starting: #{total} repo(s)" end |