Class: Dependabot::PullRequestUpdater::Gitlab
- Inherits:
-
Object
- Object
- Dependabot::PullRequestUpdater::Gitlab
- Extended by:
- T::Sig
- Defined in:
- lib/dependabot/pull_request_updater/gitlab.rb
Instance Attribute Summary collapse
-
#base_commit ⇒ Object
readonly
Returns the value of attribute base_commit.
-
#credentials ⇒ Object
readonly
Returns the value of attribute credentials.
-
#files ⇒ Object
readonly
Returns the value of attribute files.
-
#old_commit ⇒ Object
readonly
Returns the value of attribute old_commit.
-
#pull_request_number ⇒ Object
readonly
Returns the value of attribute pull_request_number.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#target_project_id ⇒ Object
readonly
Returns the value of attribute target_project_id.
Instance Method Summary collapse
-
#initialize(source:, base_commit:, old_commit:, files:, credentials:, pull_request_number:, target_project_id:) ⇒ Gitlab
constructor
A new instance of Gitlab.
- #update ⇒ Object
Constructor Details
#initialize(source:, base_commit:, old_commit:, files:, credentials:, pull_request_number:, target_project_id:) ⇒ Gitlab
Returns a new instance of Gitlab.
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/dependabot/pull_request_updater/gitlab.rb', line 50 def initialize( source:, base_commit:, old_commit:, files:, credentials:, pull_request_number:, target_project_id: ) @source = source @base_commit = base_commit @old_commit = old_commit @files = files @credentials = credentials @pull_request_number = pull_request_number @target_project_id = target_project_id end |
Instance Attribute Details
#base_commit ⇒ Object (readonly)
Returns the value of attribute base_commit.
24 25 26 |
# File 'lib/dependabot/pull_request_updater/gitlab.rb', line 24 def base_commit @base_commit end |
#credentials ⇒ Object (readonly)
Returns the value of attribute credentials.
30 31 32 |
# File 'lib/dependabot/pull_request_updater/gitlab.rb', line 30 def credentials @credentials end |
#files ⇒ Object (readonly)
Returns the value of attribute files.
21 22 23 |
# File 'lib/dependabot/pull_request_updater/gitlab.rb', line 21 def files @files end |
#old_commit ⇒ Object (readonly)
Returns the value of attribute old_commit.
27 28 29 |
# File 'lib/dependabot/pull_request_updater/gitlab.rb', line 27 def old_commit @old_commit end |
#pull_request_number ⇒ Object (readonly)
Returns the value of attribute pull_request_number.
33 34 35 |
# File 'lib/dependabot/pull_request_updater/gitlab.rb', line 33 def pull_request_number @pull_request_number end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
18 19 20 |
# File 'lib/dependabot/pull_request_updater/gitlab.rb', line 18 def source @source end |
#target_project_id ⇒ Object (readonly)
Returns the value of attribute target_project_id.
36 37 38 |
# File 'lib/dependabot/pull_request_updater/gitlab.rb', line 36 def target_project_id @target_project_id end |
Instance Method Details
#update ⇒ Object
69 70 71 72 73 74 75 |
# File 'lib/dependabot/pull_request_updater/gitlab.rb', line 69 def update return unless merge_request_exists? return unless branch_exists?(gitlab_string(merge_request, "source_branch", "merge request")) create_commit gitlab_string(merge_request, "source_branch", "merge request") end |