Class: Gitlab::Ci::ProjectConfig::Source

Inherits:
Object
  • Object
show all
Includes:
Utils::StrongMemoize
Defined in:
lib/gitlab/ci/project_config/source.rb

Direct Known Subclasses

AutoDevops, ExternalProject, Parameter, Repository

Instance Method Summary collapse

Constructor Details

#initialize(project, sha, custom_content, pipeline_source, pipeline_source_bridge) ⇒ Source

Returns a new instance of Source.



9
10
11
12
13
14
15
# File 'lib/gitlab/ci/project_config/source.rb', line 9

def initialize(project, sha, custom_content, pipeline_source, pipeline_source_bridge)
  @project = project
  @sha = sha
  @custom_content = custom_content
  @pipeline_source = pipeline_source
  @pipeline_source_bridge = pipeline_source_bridge
end

Instance Method Details

#contentObject

Raises:

  • (NotImplementedError)


23
24
25
# File 'lib/gitlab/ci/project_config/source.rb', line 23

def content
  raise NotImplementedError
end

#exists?Boolean

Returns:

  • (Boolean)


17
18
19
20
21
# File 'lib/gitlab/ci/project_config/source.rb', line 17

def exists?
  strong_memoize(:exists) do
    content.present?
  end
end

#internal_include_prepended?Boolean

Indicates if we are prepending the content with an “internal” ‘include`

Returns:

  • (Boolean)


28
29
30
# File 'lib/gitlab/ci/project_config/source.rb', line 28

def internal_include_prepended?
  false
end

#sourceObject

Raises:

  • (NotImplementedError)


32
33
34
# File 'lib/gitlab/ci/project_config/source.rb', line 32

def source
  raise NotImplementedError
end

#urlObject



36
37
38
# File 'lib/gitlab/ci/project_config/source.rb', line 36

def url
  nil
end