class Capistrano::Doctor::ServersDoctor

Attributes

servers[R]

Public Class Methods

new(env=Capistrano::Configuration.env) click to toggle source
# File lib/capistrano/doctor/servers_doctor.rb, line 8
def initialize(env=Capistrano::Configuration.env)
  @servers = env.servers.to_a
end

Public Instance Methods

call() click to toggle source
# File lib/capistrano/doctor/servers_doctor.rb, line 12
def call
  title("Servers (#{servers.size})")
  rwc = RoleWhitespaceChecker.new(servers)

  table(servers) do |server, row|
    sd = ServerDecorator.new(server)

    row << sd.uri_form
    row << sd.roles
    row << sd.properties
    row.yellow if rwc.any_has_whitespace?(server.roles)
  end

  if rwc.whitespace_roles.any?
    warning "\nWhitespace detected in role(s) #{rwc.whitespace_roles_decorated}. " \
      "This might be a result of a mistyped \"%w()\" array literal."
  end
  puts
end