Class: CircleCI::CLI::Printer::BuildPrinter
- Inherits:
-
Object
- Object
- CircleCI::CLI::Printer::BuildPrinter
- Defined in:
- lib/circleci/cli/printer/build_printer.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(builds, project_name, pretty: true) ⇒ BuildPrinter
constructor
A new instance of BuildPrinter.
- #to_s ⇒ Object
Constructor Details
#initialize(builds, project_name, pretty: true) ⇒ BuildPrinter
Returns a new instance of BuildPrinter.
19 20 21 22 23 |
# File 'lib/circleci/cli/printer/build_printer.rb', line 19 def initialize(builds, project_name, pretty: true) @builds_to_show = builds @project_name = project_name @pretty = pretty end |
Class Method Details
.header_for(build, title) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/circleci/cli/printer/build_printer.rb', line 8 def header_for(build, title) texts = [ ["Project: #{build.project_name}"], ["Build: #{build.build_number}"], ["Author: #{build.}"], ["Workflow: #{build.workflow_name}/#{build.workflow_job_name}"] ] Terminal::Table.new(title: title, rows: texts, style: { width: 120 }).to_s end |
Instance Method Details
#to_s ⇒ Object
25 26 27 |
# File 'lib/circleci/cli/printer/build_printer.rb', line 25 def to_s @pretty ? print_pretty : print_compact end |