Class: Lambda::MicroVMs::Doctor
- Inherits:
-
Object
- Object
- Lambda::MicroVMs::Doctor
- Defined in:
- lib/lambda/microvms/doctor.rb
Overview
Performs lightweight local project readiness checks.
Defined Under Namespace
Classes: Check
Instance Attribute Summary collapse
-
#project ⇒ Object
readonly
Returns the value of attribute project.
-
#runner ⇒ Object
readonly
Returns the value of attribute runner.
Instance Method Summary collapse
- #checks ⇒ Object
-
#initialize(project:, runner: Kernel) ⇒ Doctor
constructor
A new instance of Doctor.
- #ok? ⇒ Boolean
Constructor Details
#initialize(project:, runner: Kernel) ⇒ Doctor
Returns a new instance of Doctor.
12 13 14 15 |
# File 'lib/lambda/microvms/doctor.rb', line 12 def initialize(project:, runner: Kernel) @project = project @runner = runner end |
Instance Attribute Details
#project ⇒ Object (readonly)
Returns the value of attribute project.
10 11 12 |
# File 'lib/lambda/microvms/doctor.rb', line 10 def project @project end |
#runner ⇒ Object (readonly)
Returns the value of attribute runner.
10 11 12 |
# File 'lib/lambda/microvms/doctor.rb', line 10 def runner @runner end |
Instance Method Details
#checks ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/lambda/microvms/doctor.rb', line 17 def checks [ check('Ruby', RUBY_VERSION >= '3.2', RUBY_VERSION), command_check('Docker', 'docker --version'), command_check('AWS CLI', 'aws --version'), file_check('microvm.yml', project.config_path), file_check('Dockerfile', project.dockerfile), config_check('role_arn', project.role_arn), config_check('deployment.bucket', project.s3_bucket), ric_check ] end |
#ok? ⇒ Boolean
30 31 32 |
# File 'lib/lambda/microvms/doctor.rb', line 30 def ok? checks.all?(&:ok) end |