Class: Terraspace::Terraform::Tfc::Runs::Lister

Inherits:
Base
  • Object
show all
Defined in:
lib/terraspace/terraform/tfc/runs/lister.rb

Instance Method Summary collapse

Methods inherited from Base

#build_project, #initialize, #runs

Methods included from Api::Client

#api, #backend, #build, #remote, #workspace_name

Methods included from Util::Sure

#sure?

Methods included from Util::Logging

#logger

Constructor Details

This class inherits a constructor from Terraspace::Terraform::Tfc::Runs::Base

Instance Method Details

#runObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/terraspace/terraform/tfc/runs/lister.rb', line 3

def run
  build_project
  if runs.empty?
    logger.info "No runs found"
    return
  end

  presenter = CliFormat::Presenter.new(@options)
  presenter.header = ["Id", "Status", "Message", "Created At"]
  runs.each do |item|
    p = ItemPresenter.new(item)
    row = [p.id, p.status, p.message, p.created_at]
    presenter.rows << row
  end
  presenter.show
end