Module: Wary

Defined in:
lib/wary/utils/shell.rb,
lib/wary.rb,
lib/wary/check.rb,
lib/wary/status.rb,
lib/wary/version.rb,
lib/wary/load_meter.rb,
lib/wary/check_suite.rb,
lib/wary/check/http_status.rb,
lib/wary/check/load_average.rb

Overview

Pray to god that this works

Defined Under Namespace

Modules: Check, Status, Utils Classes: CheckSuite, LoadMeter, SuiteBuilder

Constant Summary collapse

VERSION =
"0.0.2"

Class Method Summary collapse

Class Method Details

.runObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/wary.rb', line 8

def self.run
  configuration = YAML.load_file(ENV['CONFIG'])
  check_suite = SuiteBuilder.new(configuration).build

  title = "Overall Check Suite Status (#{check_suite.status})"

  headings = ['Name', 'Status', 'Message']
  rows = check_suite.checks.map do |check|
    [check.name, check.status.to_sym, check.status.message]
  end

  table = Terminal::Table.new(headings: headings, rows: rows, title: title)
  table.align_column(1, :center)
  puts table
end