Class: Dependabot::PullRequestCreator::MessageBuilder
- Inherits:
-
Object
- Object
- Dependabot::PullRequestCreator::MessageBuilder
- Defined in:
- lib/dependabot/pull_request_creator/message_builder.rb
Constant Summary collapse
- ANGULAR_PREFIXES =
%w(build chore ci docs feat fix perf refactor style test).freeze
- ESLINT_PREFIXES =
%w(Breaking Build Chore Docs Fix New Update Upgrade).freeze
- GITMOJI_PREFIXES =
%w(alien ambulance apple arrow_down arrow_up art beers bento bookmark boom bug building_construction bulb busts_in_silhouette camera_flash card_file_box chart_with_upwards_trend checkered_flag children_crossing clown_face construction construction_worker egg fire globe_with_meridians green_apple green_heart hankey heavy_minus_sign heavy_plus_sign iphone lipstick lock loud_sound memo mute ok_hand package page_facing_up pencil2 penguin pushpin recycle rewind robot rocket rotating_light see_no_evil sparkles speech_balloon tada truck twisted_rightwards_arrows whale wheelchair white_check_mark wrench zap).freeze
- ISSUE_TAG_REGEX =
/(?<=[^A-Za-z0-9\[\\]|^)\\*(?<tag>(?:\#|GH-)\d+)(?=[^A-Za-z0-9\-]|$)/. freeze
- GITHUB_REF_REGEX =
%r{ (?:https?://)? github\.com/[^/\s]+/[^/\s]+/ (?:issue|pull)s?/(?<number>\d+) }x.freeze
Instance Attribute Summary collapse
-
#author_details ⇒ Object
readonly
Returns the value of attribute author_details.
-
#credentials ⇒ Object
readonly
Returns the value of attribute credentials.
-
#dependencies ⇒ Object
readonly
Returns the value of attribute dependencies.
-
#files ⇒ Object
readonly
Returns the value of attribute files.
-
#github_redirection_service ⇒ Object
readonly
Returns the value of attribute github_redirection_service.
-
#pr_message_footer ⇒ Object
readonly
Returns the value of attribute pr_message_footer.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#vulnerabilities_fixed ⇒ Object
readonly
Returns the value of attribute vulnerabilities_fixed.
Instance Method Summary collapse
- #commit_message ⇒ Object
-
#initialize(source:, dependencies:, files:, credentials:, pr_message_footer: nil, author_details: nil, vulnerabilities_fixed: {}, github_redirection_service: nil) ⇒ MessageBuilder
constructor
A new instance of MessageBuilder.
- #pr_message ⇒ Object
- #pr_name ⇒ Object
Constructor Details
#initialize(source:, dependencies:, files:, credentials:, pr_message_footer: nil, author_details: nil, vulnerabilities_fixed: {}, github_redirection_service: nil) ⇒ MessageBuilder
Returns a new instance of MessageBuilder.
43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/dependabot/pull_request_creator/message_builder.rb', line 43 def initialize(source:, dependencies:, files:, credentials:, pr_message_footer: nil, author_details: nil, vulnerabilities_fixed: {}, github_redirection_service: nil) @dependencies = dependencies @files = files @source = source @credentials = credentials @pr_message_footer = @author_details = @vulnerabilities_fixed = vulnerabilities_fixed @github_redirection_service = github_redirection_service end |
Instance Attribute Details
#author_details ⇒ Object (readonly)
Returns the value of attribute author_details.
39 40 41 |
# File 'lib/dependabot/pull_request_creator/message_builder.rb', line 39 def @author_details end |
#credentials ⇒ Object (readonly)
Returns the value of attribute credentials.
39 40 41 |
# File 'lib/dependabot/pull_request_creator/message_builder.rb', line 39 def credentials @credentials end |
#dependencies ⇒ Object (readonly)
Returns the value of attribute dependencies.
39 40 41 |
# File 'lib/dependabot/pull_request_creator/message_builder.rb', line 39 def dependencies @dependencies end |
#files ⇒ Object (readonly)
Returns the value of attribute files.
39 40 41 |
# File 'lib/dependabot/pull_request_creator/message_builder.rb', line 39 def files @files end |
#github_redirection_service ⇒ Object (readonly)
Returns the value of attribute github_redirection_service.
39 40 41 |
# File 'lib/dependabot/pull_request_creator/message_builder.rb', line 39 def github_redirection_service @github_redirection_service end |
#pr_message_footer ⇒ Object (readonly)
Returns the value of attribute pr_message_footer.
39 40 41 |
# File 'lib/dependabot/pull_request_creator/message_builder.rb', line 39 def @pr_message_footer end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
39 40 41 |
# File 'lib/dependabot/pull_request_creator/message_builder.rb', line 39 def source @source end |
#vulnerabilities_fixed ⇒ Object (readonly)
Returns the value of attribute vulnerabilities_fixed.
39 40 41 |
# File 'lib/dependabot/pull_request_creator/message_builder.rb', line 39 def vulnerabilities_fixed @vulnerabilities_fixed end |
Instance Method Details
#commit_message ⇒ Object
66 67 68 69 70 71 72 |
# File 'lib/dependabot/pull_request_creator/message_builder.rb', line 66 def = commit_subject + "\n\n" += += += "\n\n" + if end |
#pr_message ⇒ Object
62 63 64 |
# File 'lib/dependabot/pull_request_creator/message_builder.rb', line 62 def + + end |
#pr_name ⇒ Object
56 57 58 59 60 |
# File 'lib/dependabot/pull_request_creator/message_builder.rb', line 56 def pr_name return library_pr_name if library? application_pr_name end |