class CapistranoMulticonfigParallel::BundlerTerminalTable

Public Class Methods

topic() click to toggle source
# File lib/capistrano_multiconfig_parallel/celluloid/bundler_terminal_table.rb, line 4
def self.topic
  'bundler_terminal'
end

Public Instance Methods

default_heaadings() click to toggle source
# File lib/capistrano_multiconfig_parallel/celluloid/bundler_terminal_table.rb, line 8
def default_heaadings
  ['Job UUID', 'App', 'Action', 'Current Status']
end
fetch_table_size(jobs) click to toggle source
# File lib/capistrano_multiconfig_parallel/celluloid/bundler_terminal_table.rb, line 22
def fetch_table_size(jobs)
  job_rows = jobs.sum { |job, _bundler_worker| job.row_size }
  (job_rows + 2)**2
end
notify_bundler_install_status(_channel, _message) click to toggle source
# File lib/capistrano_multiconfig_parallel/celluloid/bundler_terminal_table.rb, line 16
def notify_bundler_install_status(_channel, _message)
  table = Terminal::Table.new(title: 'Bundler Check Status Table', headings: default_heaadings)
  jobs = setup_table_jobs(table)
  display_table_on_terminal(table, jobs)
end
run() click to toggle source
# File lib/capistrano_multiconfig_parallel/celluloid/bundler_terminal_table.rb, line 12
def run
  subscribe(CapistranoMulticonfigParallel::BundlerTerminalTable.topic, :notify_bundler_install_status)
end
setup_table_jobs(table) click to toggle source
# File lib/capistrano_multiconfig_parallel/celluloid/bundler_terminal_table.rb, line 28
def setup_table_jobs(table)
  jobs = managers_alive? ? @job_manager.bundler_workers_store.dup : []
  jobs.each do |job, bundler_worker|
    table.add_row(job.bundler_check_terminal_row)
    table.add_separator if jobs.keys.last != job
  end
  jobs
end