Class: Kamal::Lint::Context

Inherits:
Struct
  • Object
show all
Defined in:
lib/kamal/lint/loader.rb

Overview

Holds all the data a check needs to inspect a single Kamal config.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#base_parsedObject

Returns the value of attribute base_parsed

Returns:

  • (Object)

    the current value of base_parsed



10
11
12
# File 'lib/kamal/lint/loader.rb', line 10

def base_parsed
  @base_parsed
end

#config_fileObject

Returns the value of attribute config_file

Returns:

  • (Object)

    the current value of config_file



10
11
12
# File 'lib/kamal/lint/loader.rb', line 10

def config_file
  @config_file
end

#destinationObject

Returns the value of attribute destination

Returns:

  • (Object)

    the current value of destination



10
11
12
# File 'lib/kamal/lint/loader.rb', line 10

def destination
  @destination
end

#destination_secrets_pathObject

Returns the value of attribute destination_secrets_path

Returns:

  • (Object)

    the current value of destination_secrets_path



10
11
12
# File 'lib/kamal/lint/loader.rb', line 10

def destination_secrets_path
  @destination_secrets_path
end

#gitignore_pathObject

Returns the value of attribute gitignore_path

Returns:

  • (Object)

    the current value of gitignore_path



10
11
12
# File 'lib/kamal/lint/loader.rb', line 10

def gitignore_path
  @gitignore_path
end

#include_kamal_errorsObject

Returns the value of attribute include_kamal_errors

Returns:

  • (Object)

    the current value of include_kamal_errors



10
11
12
# File 'lib/kamal/lint/loader.rb', line 10

def include_kamal_errors
  @include_kamal_errors
end

#kamal_load_errorObject

Returns the value of attribute kamal_load_error

Returns:

  • (Object)

    the current value of kamal_load_error



10
11
12
# File 'lib/kamal/lint/loader.rb', line 10

def kamal_load_error
  @kamal_load_error
end

#kamal_loadedObject

Returns the value of attribute kamal_loaded

Returns:

  • (Object)

    the current value of kamal_loaded



10
11
12
# File 'lib/kamal/lint/loader.rb', line 10

def kamal_loaded
  @kamal_loaded
end

#kamal_versionObject

Returns the value of attribute kamal_version

Returns:

  • (Object)

    the current value of kamal_version



10
11
12
# File 'lib/kamal/lint/loader.rb', line 10

def kamal_version
  @kamal_version
end

#line_indexObject

Returns the value of attribute line_index

Returns:

  • (Object)

    the current value of line_index



10
11
12
# File 'lib/kamal/lint/loader.rb', line 10

def line_index
  @line_index
end

#override_parsedObject

Returns the value of attribute override_parsed

Returns:

  • (Object)

    the current value of override_parsed



10
11
12
# File 'lib/kamal/lint/loader.rb', line 10

def override_parsed
  @override_parsed
end

#parsedObject

Returns the value of attribute parsed

Returns:

  • (Object)

    the current value of parsed



10
11
12
# File 'lib/kamal/lint/loader.rb', line 10

def parsed
  @parsed
end

#secretsObject

Returns the value of attribute secrets

Returns:

  • (Object)

    the current value of secrets



10
11
12
# File 'lib/kamal/lint/loader.rb', line 10

def secrets
  @secrets
end

#secrets_pathObject

Returns the value of attribute secrets_path

Returns:

  • (Object)

    the current value of secrets_path



10
11
12
# File 'lib/kamal/lint/loader.rb', line 10

def secrets_path
  @secrets_path
end

#working_dirObject

Returns the value of attribute working_dir

Returns:

  • (Object)

    the current value of working_dir



10
11
12
# File 'lib/kamal/lint/loader.rb', line 10

def working_dir
  @working_dir
end

Instance Method Details

#file_for_findingObject



28
29
30
31
32
33
# File 'lib/kamal/lint/loader.rb', line 28

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



39
40
41
# File 'lib/kamal/lint/loader.rb', line 39

def line_for(path)
  line_index[Array(path).join(".")]
end

#override_fileObject



35
36
37
# File 'lib/kamal/lint/loader.rb', line 35

def override_file
  File.join(File.dirname(config_file), "deploy.#{destination}.yml")
end