Class: Ace::Support::Config::Organisms::SetupDoctor::ProviderProgress

Inherits:
Object
  • Object
show all
Defined in:
lib/ace/support/config/organisms/setup_doctor.rb

Instance Method Summary collapse

Constructor Details

#initialize(doctor, io, targets) ⇒ ProviderProgress

Returns a new instance of ProviderProgress.



853
854
855
856
857
858
859
860
# File 'lib/ace/support/config/organisms/setup_doctor.rb', line 853

def initialize(doctor, io, targets)
  @doctor = doctor
  @io = io
  @targets = targets
  @tty = io.respond_to?(:tty?) && io.tty?
  @line_count = 0
  @mutex = Mutex.new
end

Instance Method Details

#finish(index, outcome) ⇒ Object



871
872
873
874
875
876
877
878
879
880
# File 'lib/ace/support/config/organisms/setup_doctor.rb', line 871

def finish(index, outcome)
  @mutex.synchronize do
    if @tty
      rewrite_line(index, outcome)
    else
      @io.puts "  #{format_line(outcome, status: outcome[:status], elapsed_ms: outcome[:elapsed_ms])}"
    end
    flush
  end
end

#startObject



862
863
864
865
866
867
868
869
# File 'lib/ace/support/config/organisms/setup_doctor.rb', line 862

def start
  @io.puts "RUN Utility provider pings running (0/#{@targets.length} passed)"
  @targets.each do |target|
    @io.puts "  #{format_line(target, status: "running")}"
  end
  @line_count = @targets.length
  flush
end