Class: LearnDoctor::HealthCheck

Inherits:
Object
  • Object
show all
Defined in:
lib/learn_doctor/health_check.rb,
lib/learn_doctor/health_check/file.rb,
lib/learn_doctor/health_check/step_checker.rb,
lib/learn_doctor/health_check/step_installer.rb

Defined Under Namespace

Classes: File, StepChecker, StepInstaller

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeHealthCheck

Returns a new instance of HealthCheck.



14
15
16
17
18
19
# File 'lib/learn_doctor/health_check.rb', line 14

def initialize
  , token = Netrc.read['learn-config']
  @client       = LearnWeb::Client.new(token: token)
  @passed_steps = []
  @failed_steps = []
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



7
8
9
# File 'lib/learn_doctor/health_check.rb', line 7

def client
  @client
end

#failed_stepsObject (readonly)

Returns the value of attribute failed_steps.



7
8
9
# File 'lib/learn_doctor/health_check.rb', line 7

def failed_steps
  @failed_steps
end

#passed_stepsObject (readonly)

Returns the value of attribute passed_steps.



7
8
9
# File 'lib/learn_doctor/health_check.rb', line 7

def passed_steps
  @passed_steps
end

#setup_step_listObject

Returns the value of attribute setup_step_list.



8
9
10
# File 'lib/learn_doctor/health_check.rb', line 8

def setup_step_list
  @setup_step_list
end

Class Method Details

.diagnoseObject



10
11
12
# File 'lib/learn_doctor/health_check.rb', line 10

def self.diagnose
  new.diagnose
end

Instance Method Details

#diagnoseObject



21
22
23
24
25
26
# File 'lib/learn_doctor/health_check.rb', line 21

def diagnose
  ensure_correct_rake!
  get_setup_step_list!
  run_checks!
  install_failures!
end