Class: RepoTender::UI::PlainReporter

Inherits:
Object
  • Object
show all
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

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

#detachObject



18
# File 'lib/repo_tender/ui/plain_reporter.rb', line 18

def detach = nil

#listing_finishedObject



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