lib/gush/cli/overview.rb in gush-0.2.2 vs lib/gush/cli/overview.rb in gush-0.2.3
- old
+ new
@@ -19,11 +19,11 @@
elsif workflow.finished?
"done".green
elsif workflow.stopped?
"stopped".red
else
- running_status
+ "ready to start".blue
end
end
def jobs_list(jobs)
"\nJobs list:\n".tap do |output|
@@ -51,20 +51,25 @@
"Failed jobs" => failed_jobs_count.red,
"Succeeded jobs" => succeeded_jobs_count.green,
"Enqueued jobs" => enqueued_jobs_count.yellow,
"Running jobs" => running_jobs_count.blue,
"Remaining jobs" => remaining_jobs_count,
+ "Started at" => started_at,
"Status" => status
}
end
def running_status
finished = succeeded_jobs_count.to_i
status = "running".yellow
status += "\n#{finished}/#{total_jobs_count} [#{(finished*100)/total_jobs_count}%]"
end
+ def started_at
+ workflow.started_at.inspect
+ end
+
def failed_status
status = "failed".light_red
status += "\n#{failed_job} failed"
end
@@ -129,10 +134,10 @@
def running_jobs_count
workflow.jobs.count(&:running?).to_s
end
def remaining_jobs_count
- workflow.jobs.count{|j| [j.finished, j.failed, j.enqueued].none? }.to_s
+ workflow.jobs.count{|j| [j.finished?, j.failed?, j.enqueued?].none? }.to_s
end
end
end
end