Class: Gitlab::Ci::Pipeline::Chain::Config::Content::Source
- Inherits:
-
Object
- Object
- Gitlab::Ci::Pipeline::Chain::Config::Content::Source
show all
- Includes:
- Utils::StrongMemoize
- Defined in:
- lib/gitlab/ci/pipeline/chain/config/content/source.rb
Constant Summary
collapse
- DEFAULT_YAML_FILE =
'.gitlab-ci.yml'
Instance Attribute Summary collapse
Instance Method Summary
collapse
#clear_memoization, #strong_memoize, #strong_memoized?
Constructor Details
#initialize(pipeline, command) ⇒ Source
Returns a new instance of Source.
16
17
18
19
|
# File 'lib/gitlab/ci/pipeline/chain/config/content/source.rb', line 16
def initialize(pipeline, command)
@pipeline = pipeline
@command = command
end
|
Instance Attribute Details
#command ⇒ Object
Returns the value of attribute command
14
15
16
|
# File 'lib/gitlab/ci/pipeline/chain/config/content/source.rb', line 14
def command
@command
end
|
Instance Method Details
#ci_config_path ⇒ Object
39
40
41
|
# File 'lib/gitlab/ci/pipeline/chain/config/content/source.rb', line 39
def ci_config_path
@ci_config_path ||= project.ci_config_path.presence || DEFAULT_YAML_FILE
end
|
#content ⇒ Object
27
28
29
|
# File 'lib/gitlab/ci/pipeline/chain/config/content/source.rb', line 27
def content
raise NotImplementedError
end
|
#exists? ⇒ Boolean
21
22
23
24
25
|
# File 'lib/gitlab/ci/pipeline/chain/config/content/source.rb', line 21
def exists?
strong_memoize(:exists) do
content.present?
end
end
|
#project ⇒ Object
35
36
37
|
# File 'lib/gitlab/ci/pipeline/chain/config/content/source.rb', line 35
def project
@project ||= @pipeline.project
end
|
#source ⇒ Object
31
32
33
|
# File 'lib/gitlab/ci/pipeline/chain/config/content/source.rb', line 31
def source
raise NotImplementedError
end
|