Module: Aircana::CLI::DoctorHelpers::ConfigurationChecks

Included in:
Aircana::CLI::Doctor
Defined in:
lib/aircana/cli/commands/doctor_helpers.rb

Instance Method Summary collapse

Instance Method Details

#check_directory(path, description) ⇒ Object



73
74
75
76
77
78
79
80
81
# File 'lib/aircana/cli/commands/doctor_helpers.rb', line 73

def check_directory(path, description)
  expanded_path = File.expand_path(path)
  if Dir.exist?(expanded_path)
    log_success(File.basename(path), "#{description} exists")
  else
    log_info(File.basename(path), "#{description} not found")
    log_remedy("Will be created on first use")
  end
end

#confluence_configured?(config) ⇒ Boolean

Returns:

  • (Boolean)


63
64
65
66
67
# File 'lib/aircana/cli/commands/doctor_helpers.rb', line 63

def confluence_configured?(config)
  !config.confluence_base_url.to_s.empty? &&
    !config.confluence_username.to_s.empty? &&
    !config.confluence_api_token.to_s.empty?
end

#find_available_editorsObject



69
70
71
# File 'lib/aircana/cli/commands/doctor_helpers.rb', line 69

def find_available_editors
  %w[code subl atom nano vim vi].select { |cmd| command_available?(cmd) }
end