Class: Dependabot::PullRequestCreator::PrNamePrefixer
- Inherits:
-
Object
- Object
- Dependabot::PullRequestCreator::PrNamePrefixer
- Defined in:
- lib/hack/dependabot-core/common/lib/dependabot/pull_request_creator/pr_name_prefixer.rb
Instance Method Summary collapse
- #gitea_client_for_source ⇒ Object
- #last_dependabot_commit_message ⇒ Object
- #last_gitea_dependabot_commit_message ⇒ Object
-
#recent_commit_messages ⇒ Object
override.
- #recent_gitea_commit_messages ⇒ Object
- #recent_gitea_commits ⇒ Object
Instance Method Details
#gitea_client_for_source ⇒ Object
56 57 58 59 60 61 62 |
# File 'lib/hack/dependabot-core/common/lib/dependabot/pull_request_creator/pr_name_prefixer.rb', line 56 def gitea_client_for_source @gitea_client_for_source ||= Dependabot::Clients::Gitea.for_source( source: source, credentials: credentials ) end |
#last_dependabot_commit_message ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/hack/dependabot-core/common/lib/dependabot/pull_request_creator/pr_name_prefixer.rb', line 30 def @last_dependabot_commit_message ||= case source.provider when "github" then when "gitlab" then when "azure" then when "gitea" then when "codecommit" then else raise "Unsupported provider: #{source.provider}" end end |
#last_gitea_dependabot_commit_message ⇒ Object
42 43 44 45 46 47 48 49 |
# File 'lib/hack/dependabot-core/common/lib/dependabot/pull_request_creator/pr_name_prefixer.rb', line 42 def recent_gitea_commits. reject { |c| c.commit&.&.start_with?("Merge") }. find { |c| c.commit.&.name&.include?("dependabot") }&. commit&. &. strip end |
#recent_commit_messages ⇒ Object
override
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/hack/dependabot-core/common/lib/dependabot/pull_request_creator/pr_name_prefixer.rb', line 9 def case source.provider when "github" then when "gitlab" then when "azure" then when "gitea" then when "codecommit" then else raise "Unsupported provider: #{source.provider}" end end |
#recent_gitea_commit_messages ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/hack/dependabot-core/common/lib/dependabot/pull_request_creator/pr_name_prefixer.rb', line 20 def recent_gitea_commits. reject { |c| c.&.type == "Bot" }. reject { |c| c.commit&.&.start_with?("Merge") }. map(&:commit). map(&:message). compact. map(&:strip) end |
#recent_gitea_commits ⇒ Object
51 52 53 54 |
# File 'lib/hack/dependabot-core/common/lib/dependabot/pull_request_creator/pr_name_prefixer.rb', line 51 def recent_gitea_commits @recent_gitea_commits ||= gitea_client_for_source.commits end |