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

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

Direct Known Subclasses

Header::Processor

Constant Summary collapse

IncludeError =
Class.new(StandardError)
DuplicateInputError =
Class.new(IncludeError)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(values, context) ⇒ Processor

Returns a new instance of Processor.



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

def initialize(values, context)
  @values = values
  @context = context
  @external_files = mapper.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.



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

def context
  @context
end

#loggerObject (readonly)

Returns the value of attribute logger.



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

def logger
  @logger
end

Instance Method Details

#performObject



24
25
26
27
28
29
30
31
32
33
34
# File 'lib/gitlab/ci/config/external/processor.rb', line 24

def perform
  return @values if @external_files.empty?

  validate_external_files!
  merge_external_files!
  append_inline_content!
  remove_include_keyword!
  validate!

  @content
end