class Bard::CI::Local

Public Instance Methods

console() click to toggle source
# File lib/bard/ci/local.rb, line 27
def console
  @console
end
exists?() click to toggle source
# File lib/bard/ci/local.rb, line 23
def exists?
  true
end
run() { |elapsed_time, nil| ... } click to toggle source
# File lib/bard/ci/local.rb, line 6
def run
  start

  start_time = Time.new.to_i
  while building?
    elapsed_time = Time.new.to_i - start_time
    yield elapsed_time, nil
    sleep(2)
  end

  @stdin.close
  @console = @stdout_and_stderr.read
  @stdout_and_stderr.close

  success?
end

Private Instance Methods

building?() click to toggle source
# File lib/bard/ci/local.rb, line 37
def building?
  ![nil, false].include?(@wait_thread.status)
end
start() click to toggle source
# File lib/bard/ci/local.rb, line 33
def start
  @stdin, @stdout_and_stderr, @wait_thread = Open3.popen2e("CLEAN=true bin/rake ci")
end
success?() click to toggle source
# File lib/bard/ci/local.rb, line 41
def success?
  @wait_thread.value.success?
end