Class: Taeval::Hadolint::Config

Inherits:
Object
  • Object
show all
Includes:
FileHelper
Defined in:
lib/taeval/hadolint/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from FileHelper

#create, #exist?, #flatten_include!, #open, #path_of

Constructor Details

#initialize(conf_h) ⇒ Config

Returns a new instance of Config.



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/taeval/hadolint/config.rb', line 9

def initialize(conf_h)
  @path      = path_of(conf_h.fetch('path', ''))
  if !File.exist?(@path)
    raise "Path of hadolint (#{@path}) does not exist."
  end
  
  @solutions = path_of(conf_h.dig('solution', 'path'))
  if !File.exist?(@solutions)
    raise "Path of solutions (#{@solutions}) does not exist."
  end
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



7
8
9
# File 'lib/taeval/hadolint/config.rb', line 7

def path
  @path
end

#solutionsObject (readonly)

Returns the value of attribute solutions.



7
8
9
# File 'lib/taeval/hadolint/config.rb', line 7

def solutions
  @solutions
end