Class: Dependabot::PullRequestUpdater::Gitlab
- Inherits:
-
Object
- Object
- Dependabot::PullRequestUpdater::Gitlab
- 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.
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/dependabot/pull_request_updater/gitlab.rb', line 14 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.
11 12 13 |
# File 'lib/dependabot/pull_request_updater/gitlab.rb', line 11 def base_commit @base_commit end |
#credentials ⇒ Object (readonly)
Returns the value of attribute credentials.
11 12 13 |
# File 'lib/dependabot/pull_request_updater/gitlab.rb', line 11 def credentials @credentials end |
#files ⇒ Object (readonly)
Returns the value of attribute files.
11 12 13 |
# File 'lib/dependabot/pull_request_updater/gitlab.rb', line 11 def files @files end |
#old_commit ⇒ Object (readonly)
Returns the value of attribute old_commit.
11 12 13 |
# File 'lib/dependabot/pull_request_updater/gitlab.rb', line 11 def old_commit @old_commit end |
#pull_request_number ⇒ Object (readonly)
Returns the value of attribute pull_request_number.
11 12 13 |
# File 'lib/dependabot/pull_request_updater/gitlab.rb', line 11 def pull_request_number @pull_request_number end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
11 12 13 |
# File 'lib/dependabot/pull_request_updater/gitlab.rb', line 11 def source @source end |
#target_project_id ⇒ Object (readonly)
Returns the value of attribute target_project_id.
11 12 13 |
# File 'lib/dependabot/pull_request_updater/gitlab.rb', line 11 def target_project_id @target_project_id end |
Instance Method Details
#update ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/dependabot/pull_request_updater/gitlab.rb', line 25 def update return unless merge_request_exists? return unless branch_exists?(merge_request.source_branch) create_commit merge_request.source_branch end |