Class: Dependabot::PullRequestCreator::MessageBuilder
- Inherits:
-
Object
- Object
- Dependabot::PullRequestCreator::MessageBuilder
- Defined in:
- lib/dependabot/pull_request_creator/message_builder.rb,
lib/dependabot/pull_request_creator/message_builder/issue_linker.rb,
lib/dependabot/pull_request_creator/message_builder/metadata_presenter.rb,
lib/dependabot/pull_request_creator/message_builder/link_and_mention_sanitizer.rb
Defined Under Namespace
Classes: IssueLinker, LinkAndMentionSanitizer, MetadataPresenter
Instance Attribute Summary collapse
-
#commit_message_options ⇒ Object
readonly
Returns the value of attribute commit_message_options.
-
#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.
-
#pr_message_header ⇒ Object
readonly
Returns the value of attribute pr_message_header.
-
#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_header: nil, pr_message_footer: nil, commit_message_options: {}, 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_header: nil, pr_message_footer: nil, commit_message_options: {}, vulnerabilities_fixed: {}, github_redirection_service: nil) ⇒ MessageBuilder
Returns a new instance of MessageBuilder.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/dependabot/pull_request_creator/message_builder.rb', line 23 def initialize(source:, dependencies:, files:, credentials:, pr_message_header: nil, pr_message_footer: nil, commit_message_options: {}, vulnerabilities_fixed: {}, github_redirection_service: nil) @dependencies = dependencies @files = files @source = source @credentials = credentials @pr_message_header = @pr_message_footer = @commit_message_options = @vulnerabilities_fixed = vulnerabilities_fixed @github_redirection_service = github_redirection_service end |
Instance Attribute Details
#commit_message_options ⇒ Object (readonly)
Returns the value of attribute commit_message_options.
18 19 20 |
# File 'lib/dependabot/pull_request_creator/message_builder.rb', line 18 def @commit_message_options end |
#credentials ⇒ Object (readonly)
Returns the value of attribute credentials.
18 19 20 |
# File 'lib/dependabot/pull_request_creator/message_builder.rb', line 18 def credentials @credentials end |
#dependencies ⇒ Object (readonly)
Returns the value of attribute dependencies.
18 19 20 |
# File 'lib/dependabot/pull_request_creator/message_builder.rb', line 18 def dependencies @dependencies end |
#files ⇒ Object (readonly)
Returns the value of attribute files.
18 19 20 |
# File 'lib/dependabot/pull_request_creator/message_builder.rb', line 18 def files @files end |
#github_redirection_service ⇒ Object (readonly)
Returns the value of attribute github_redirection_service.
18 19 20 |
# File 'lib/dependabot/pull_request_creator/message_builder.rb', line 18 def github_redirection_service @github_redirection_service end |
#pr_message_footer ⇒ Object (readonly)
Returns the value of attribute pr_message_footer.
18 19 20 |
# File 'lib/dependabot/pull_request_creator/message_builder.rb', line 18 def @pr_message_footer end |
#pr_message_header ⇒ Object (readonly)
Returns the value of attribute pr_message_header.
18 19 20 |
# File 'lib/dependabot/pull_request_creator/message_builder.rb', line 18 def @pr_message_header end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
18 19 20 |
# File 'lib/dependabot/pull_request_creator/message_builder.rb', line 18 def source @source end |
#vulnerabilities_fixed ⇒ Object (readonly)
Returns the value of attribute vulnerabilities_fixed.
18 19 20 |
# File 'lib/dependabot/pull_request_creator/message_builder.rb', line 18 def vulnerabilities_fixed @vulnerabilities_fixed end |
Instance Method Details
#commit_message ⇒ Object
51 52 53 54 55 56 57 |
# File 'lib/dependabot/pull_request_creator/message_builder.rb', line 51 def = commit_subject + "\n\n" += += += "\n\n" + if end |
#pr_message ⇒ Object
46 47 48 49 |
# File 'lib/dependabot/pull_request_creator/message_builder.rb', line 46 def + + \ + end |
#pr_name ⇒ Object
38 39 40 41 42 43 44 |
# File 'lib/dependabot/pull_request_creator/message_builder.rb', line 38 def pr_name pr_name = pr_name_prefixer.pr_name_prefix pr_name += library? ? library_pr_name : application_pr_name return pr_name if files.first.directory == "/" pr_name + " in #{files.first.directory}" end |