Class: Gitlab::Ci::Config::External::File::Project
- Extended by:
- Utils::Override
- Includes:
- Utils::StrongMemoize
- Defined in:
- lib/gitlab/ci/config/external/file/project.rb
Constant Summary
Constants inherited from Base
Base::YAML_WHITELIST_EXTENSION
Instance Attribute Summary collapse
-
#project_name ⇒ Object
readonly
Returns the value of attribute project_name.
-
#ref_name ⇒ Object
readonly
Returns the value of attribute ref_name.
Attributes inherited from Base
#context, #errors, #location, #params
Instance Method Summary collapse
- #content ⇒ Object
-
#initialize(params, context) ⇒ Project
constructor
A new instance of Project.
- #matching? ⇒ Boolean
- #metadata ⇒ Object
Methods included from Utils::Override
extended, extensions, included, method_added, override, prepended, queue_verification, verify!
Methods included from Utils::StrongMemoize
#clear_memoization, #strong_memoize, #strong_memoized?
Methods inherited from Base
#eql?, #error_message, #hash, #invalid_extension?, #invalid_location_type?, #to_hash, #valid?, #validate!
Constructor Details
#initialize(params, context) ⇒ Project
Returns a new instance of Project.
14 15 16 17 18 19 20 |
# File 'lib/gitlab/ci/config/external/file/project.rb', line 14 def initialize(params, context) @location = params[:file] @project_name = params[:project] @ref_name = params[:ref] || 'HEAD' super end |
Instance Attribute Details
#project_name ⇒ Object (readonly)
Returns the value of attribute project_name.
12 13 14 |
# File 'lib/gitlab/ci/config/external/file/project.rb', line 12 def project_name @project_name end |
#ref_name ⇒ Object (readonly)
Returns the value of attribute ref_name.
12 13 14 |
# File 'lib/gitlab/ci/config/external/file/project.rb', line 12 def ref_name @ref_name end |
Instance Method Details
#content ⇒ Object
26 27 28 |
# File 'lib/gitlab/ci/config/external/file/project.rb', line 26 def content strong_memoize(:content) { fetch_local_content } end |
#matching? ⇒ Boolean
22 23 24 |
# File 'lib/gitlab/ci/config/external/file/project.rb', line 22 def matching? super && project_name.present? end |
#metadata ⇒ Object
30 31 32 33 34 35 36 37 38 |
# File 'lib/gitlab/ci/config/external/file/project.rb', line 30 def super.merge( type: :file, location: masked_location, blob: masked_blob, raw: masked_raw, extra: { project: masked_project_name, ref: masked_ref_name } ) end |