Class: Bard::CLI::Ping

Inherits:
Command
  • Object
show all
Defined in:
lib/bard/cli/ping.rb

Instance Method Summary collapse

Methods inherited from Command

desc, option, setup

Instance Method Details

#ping(server = :production) ⇒ Object



6
7
8
9
10
11
# File 'lib/bard/cli/ping.rb', line 6

def ping server=:production
  server = config[server]
  down_urls = Bard::Ping.call(config[server])
  down_urls.each { |url| puts "#{url} is down!" }
  exit 1 if down_urls.any?
end