Class: Dash::Cli::Report

Inherits:
Base
  • Object
show all
Defined in:
lib/dash/cli/report.rb

Overview

Reads the JSON reports every deploy leaves under .dash/reports.

Entirely local and read-only: no lock, no SSH, nothing that can change a server. It is the command to reach for after a deploy has finished and the table has scrolled away, and the one that answers "was it always this slow?".

Constant Summary collapse

TREND_HEADINGS =
%w[ started version total build boot advice ].freeze
COLUMNS =
"  %-20s %-10s %8s %8s %8s  %s".freeze

Constants inherited from Base

Base::AUTOMATIC_DEPLOY_LOCK_MESSAGE, Base::HOOK_MUTEX, Base::VERBOSITY

Instance Method Summary collapse

Methods inherited from Base

dynamic_command_class, exit_on_failure?, #initialize

Constructor Details

This class inherits a constructor from Dash::Cli::Base

Instance Method Details

#path ⇒ Object



27
28
29
# File 'lib/dash/cli/report.rb', line 27

def path
  puts reports_directory
end

#show ⇒ Object



16
17
18
19
20
21
22
23
24
# File 'lib/dash/cli/report.rb', line 16

def show
  if (last = options[:last])
    return say "--last takes a positive number of reports, got #{last}", :red unless count?(last)

    print_trend saved.recent(last.to_i)
  else
    print_latest saved.recent(1).first
  end
end