Class: Dependabot::PullRequestUpdater
- Inherits:
-
Object
- Object
- Dependabot::PullRequestUpdater
- Extended by:
- T::Sig
- Defined in:
- lib/dependabot/pull_request_updater.rb,
lib/dependabot/pull_request_updater/azure.rb,
lib/dependabot/pull_request_updater/github.rb,
lib/dependabot/pull_request_updater/gitlab.rb
Defined Under Namespace
Classes: Azure, BranchProtected, Github, Gitlab
Constant Summary collapse
- UpdateResult =
T.type_alias { T.nilable(T.any(Sawyer::Resource, String)) }
Instance Attribute Summary collapse
-
#author_details ⇒ Object
readonly
Returns the value of attribute author_details.
-
#base_commit ⇒ Object
readonly
Returns the value of attribute base_commit.
-
#commit_message ⇒ Object
readonly
Returns the value of attribute commit_message.
-
#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.
-
#provider_metadata ⇒ Object
readonly
Returns the value of attribute provider_metadata.
-
#pull_request_number ⇒ Object
readonly
Returns the value of attribute pull_request_number.
-
#signature_key ⇒ Object
readonly
Returns the value of attribute signature_key.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
-
#initialize(source:, base_commit:, old_commit:, files:, credentials:, pull_request_number:, author_details: nil, signature_key: nil, commit_message: nil, provider_metadata: {}) ⇒ PullRequestUpdater
constructor
A new instance of PullRequestUpdater.
- #update ⇒ Object
Constructor Details
#initialize(source:, base_commit:, old_commit:, files:, credentials:, pull_request_number:, author_details: nil, signature_key: nil, commit_message: nil, provider_metadata: {}) ⇒ PullRequestUpdater
Returns a new instance of PullRequestUpdater.
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/dependabot/pull_request_updater.rb', line 63 def initialize( source:, base_commit:, old_commit:, files:, credentials:, pull_request_number:, author_details: nil, signature_key: nil, commit_message: nil, provider_metadata: {} ) @source = source @base_commit = base_commit @old_commit = old_commit @files = files @credentials = credentials @pull_request_number = pull_request_number @author_details = @signature_key = signature_key @commit_message = @provider_metadata = end |
Instance Attribute Details
#author_details ⇒ Object (readonly)
Returns the value of attribute author_details.
37 38 39 |
# File 'lib/dependabot/pull_request_updater.rb', line 37 def @author_details end |
#base_commit ⇒ Object (readonly)
Returns the value of attribute base_commit.
25 26 27 |
# File 'lib/dependabot/pull_request_updater.rb', line 25 def base_commit @base_commit end |
#commit_message ⇒ Object (readonly)
Returns the value of attribute commit_message.
43 44 45 |
# File 'lib/dependabot/pull_request_updater.rb', line 43 def @commit_message end |
#credentials ⇒ Object (readonly)
Returns the value of attribute credentials.
31 32 33 |
# File 'lib/dependabot/pull_request_updater.rb', line 31 def credentials @credentials end |
#files ⇒ Object (readonly)
Returns the value of attribute files.
22 23 24 |
# File 'lib/dependabot/pull_request_updater.rb', line 22 def files @files end |
#old_commit ⇒ Object (readonly)
Returns the value of attribute old_commit.
28 29 30 |
# File 'lib/dependabot/pull_request_updater.rb', line 28 def old_commit @old_commit end |
#provider_metadata ⇒ Object (readonly)
Returns the value of attribute provider_metadata.
46 47 48 |
# File 'lib/dependabot/pull_request_updater.rb', line 46 def @provider_metadata end |
#pull_request_number ⇒ Object (readonly)
Returns the value of attribute pull_request_number.
34 35 36 |
# File 'lib/dependabot/pull_request_updater.rb', line 34 def pull_request_number @pull_request_number end |
#signature_key ⇒ Object (readonly)
Returns the value of attribute signature_key.
40 41 42 |
# File 'lib/dependabot/pull_request_updater.rb', line 40 def signature_key @signature_key end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
19 20 21 |
# File 'lib/dependabot/pull_request_updater.rb', line 19 def source @source end |
Instance Method Details
#update ⇒ Object
88 89 90 91 92 93 94 95 |
# File 'lib/dependabot/pull_request_updater.rb', line 88 def update case source.provider when "github" then github_updater.update when "gitlab" then gitlab_updater.update when "azure" then azure_updater.update else raise "Unsupported provider #{source.provider}" end end |