Skip to content

Commit

Permalink
forgot to commit the bundler table
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdanRada committed Jul 19, 2016
1 parent 19c86bd commit 286bab3
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
module CapistranoMulticonfigParallel
class BundlerTerminalTable < CapistranoMulticonfigParallel::TerminalTable

def self.topic
'bundler_terminal'
end

def default_heaadings
['Job UUID', 'App', 'Action', 'Current Status']
end

def run
subscribe(CapistranoMulticonfigParallel::BundlerTerminalTable.topic, :notify_bundler_install_status)
end

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

def fetch_table_size(jobs)
job_rows = jobs.sum { |job, _bundler_worker| job.row_size }
(job_rows + 2)**2
end


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

def managers_alive?
@job_manager.alive?
end

end
end
2 changes: 1 addition & 1 deletion lib/capistrano_multiconfig_parallel/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module VERSION

MAJOR = 2
MINOR = 0
TINY = 2
TINY = 3
PRE = nil

STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
Expand Down

0 comments on commit 286bab3

Please sign in to comment.