Class: Kdep::Doctor::CheckStateParseable

Inherits:
Check
  • Object
show all
Defined in:
lib/kdep/doctor/check_state_parseable.rb

Constant Summary collapse

ID =
"state_parseable".freeze

Instance Attribute Summary

Attributes inherited from Check

#deploy_dir

Instance Method Summary collapse

Methods inherited from Check

#initialize

Constructor Details

This class inherits a constructor from Kdep::Doctor::Check

Instance Method Details

#runObject



8
9
10
11
12
13
14
15
16
# File 'lib/kdep/doctor/check_state_parseable.rb', line 8

def run
  return Result.ok(ID) unless Kdep::State.exists?(deploy_dir)
  begin
    Kdep::State.load(deploy_dir)
    Result.ok(ID)
  rescue Kdep::State::Error => e
    Result.new(id: ID, severity: :error, message: e.message)
  end
end