Class: Kamal::Lint::Context
- Inherits:
-
Struct
- Object
- Struct
- Kamal::Lint::Context
- Defined in:
- lib/kamal/lint/loader.rb
Overview
Holds all the data a check needs to inspect a single Kamal config: the parsed YAML, the source lines, helper to look up source lines for a given path (for finding line numbers), the destination override, the secrets file contents, and a flag indicating whether Kamal’s own loader rejected the config (in which case some checks are skipped to avoid cascading false positives).
Instance Attribute Summary collapse
-
#base_parsed ⇒ Object
Returns the value of attribute base_parsed.
-
#config_file ⇒ Object
Returns the value of attribute config_file.
-
#destination ⇒ Object
Returns the value of attribute destination.
-
#gitignore_path ⇒ Object
Returns the value of attribute gitignore_path.
-
#kamal_load_error ⇒ Object
Returns the value of attribute kamal_load_error.
-
#kamal_loaded ⇒ Object
Returns the value of attribute kamal_loaded.
-
#kamal_version ⇒ Object
Returns the value of attribute kamal_version.
-
#line_index ⇒ Object
Returns the value of attribute line_index.
-
#override_parsed ⇒ Object
Returns the value of attribute override_parsed.
-
#parsed ⇒ Object
Returns the value of attribute parsed.
-
#secrets ⇒ Object
Returns the value of attribute secrets.
-
#secrets_path ⇒ Object
Returns the value of attribute secrets_path.
-
#source_lines ⇒ Object
Returns the value of attribute source_lines.
-
#working_dir ⇒ Object
Returns the value of attribute working_dir.
Instance Method Summary collapse
Instance Attribute Details
#base_parsed ⇒ Object
Returns the value of attribute base_parsed
15 16 17 |
# File 'lib/kamal/lint/loader.rb', line 15 def base_parsed @base_parsed end |
#config_file ⇒ Object
Returns the value of attribute config_file
15 16 17 |
# File 'lib/kamal/lint/loader.rb', line 15 def config_file @config_file end |
#destination ⇒ Object
Returns the value of attribute destination
15 16 17 |
# File 'lib/kamal/lint/loader.rb', line 15 def destination @destination end |
#gitignore_path ⇒ Object
Returns the value of attribute gitignore_path
15 16 17 |
# File 'lib/kamal/lint/loader.rb', line 15 def gitignore_path @gitignore_path end |
#kamal_load_error ⇒ Object
Returns the value of attribute kamal_load_error
15 16 17 |
# File 'lib/kamal/lint/loader.rb', line 15 def kamal_load_error @kamal_load_error end |
#kamal_loaded ⇒ Object
Returns the value of attribute kamal_loaded
15 16 17 |
# File 'lib/kamal/lint/loader.rb', line 15 def kamal_loaded @kamal_loaded end |
#kamal_version ⇒ Object
Returns the value of attribute kamal_version
15 16 17 |
# File 'lib/kamal/lint/loader.rb', line 15 def kamal_version @kamal_version end |
#line_index ⇒ Object
Returns the value of attribute line_index
15 16 17 |
# File 'lib/kamal/lint/loader.rb', line 15 def line_index @line_index end |
#override_parsed ⇒ Object
Returns the value of attribute override_parsed
15 16 17 |
# File 'lib/kamal/lint/loader.rb', line 15 def override_parsed @override_parsed end |
#parsed ⇒ Object
Returns the value of attribute parsed
15 16 17 |
# File 'lib/kamal/lint/loader.rb', line 15 def parsed @parsed end |
#secrets ⇒ Object
Returns the value of attribute secrets
15 16 17 |
# File 'lib/kamal/lint/loader.rb', line 15 def secrets @secrets end |
#secrets_path ⇒ Object
Returns the value of attribute secrets_path
15 16 17 |
# File 'lib/kamal/lint/loader.rb', line 15 def secrets_path @secrets_path end |
#source_lines ⇒ Object
Returns the value of attribute source_lines
15 16 17 |
# File 'lib/kamal/lint/loader.rb', line 15 def source_lines @source_lines end |
#working_dir ⇒ Object
Returns the value of attribute working_dir
15 16 17 |
# File 'lib/kamal/lint/loader.rb', line 15 def working_dir @working_dir end |
Instance Method Details
#file_for_finding ⇒ Object
32 33 34 35 36 37 |
# File 'lib/kamal/lint/loader.rb', line 32 def file_for_finding return config_file unless destination override_path = override_file File.exist?(override_path) ? override_path : config_file end |
#line_for(path) ⇒ Object
43 44 45 |
# File 'lib/kamal/lint/loader.rb', line 43 def line_for(path) line_index[Array(path).join(".")] end |
#override_file ⇒ Object
39 40 41 |
# File 'lib/kamal/lint/loader.rb', line 39 def override_file File.join(File.dirname(config_file), "deploy.#{destination}.yml") end |