Class: Gitlab::Ci::Config::External::Processor

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/ci/config/external/processor.rb

Constant Summary collapse

IncludeError =
Class.new(StandardError)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(values, context) ⇒ Processor

Returns a new instance of Processor.



12
13
14
15
16
17
18
19
20
# File 'lib/gitlab/ci/config/external/processor.rb', line 12

def initialize(values, context)
  @values = values
  @external_files = External::Mapper.new(values, context).process
  @content = {}
  @logger = context.logger
rescue External::Mapper::Error,
       OpenSSL::SSL::SSLError => e
  raise IncludeError, e.message
end

Instance Attribute Details

#contextObject (readonly)

Returns the value of attribute context.



10
11
12
# File 'lib/gitlab/ci/config/external/processor.rb', line 10

def context
  @context
end

#loggerObject (readonly)

Returns the value of attribute logger.



10
11
12
# File 'lib/gitlab/ci/config/external/processor.rb', line 10

def logger
  @logger
end

Instance Method Details

#performObject



22
23
24
25
26
27
28
29
# File 'lib/gitlab/ci/config/external/processor.rb', line 22

def perform
  return @values if @external_files.empty?

  validate_external_files!
  merge_external_files!
  append_inline_content!
  remove_include_keyword!
end