Class: Capistrano::Doctor::VariablesDoctor

Inherits:
Object
  • Object
show all
Includes:
OutputHelpers
Defined in:
lib/capistrano/doctor/variables_doctor.rb

Overview

Prints a table of all Capistrano variables and their current values. If there are unrecognized variables, print warnings for them.

Instance Method Summary collapse

Methods included from OutputHelpers

#puts, #table, #title, #warning

Constructor Details

#initialize(env = Capistrano::Configuration.env) ⇒ VariablesDoctor

Returns a new instance of VariablesDoctor.



24
25
26
# File 'lib/capistrano/doctor/variables_doctor.rb', line 24

def initialize(env=Capistrano::Configuration.env)
  @env = env
end

Instance Method Details

#callObject



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/capistrano/doctor/variables_doctor.rb', line 28

def call
  title("Variables")
  values = inspect_all_values

  table(variables.keys.sort_by(&:to_s)) do |key, row|
    row.yellow if suspicious_keys.include?(key)
    row << key.inspect
    row << values[key]
  end

  puts if suspicious_keys.any?

  suspicious_keys.sort_by(&:to_s).each do |key|
    warning("#{key.inspect} is not a recognized Capistrano setting "\
            "(#{location(key)})")
  end
end