Class: Dependabot::PullRequestCreator::MessageBuilder::MetadataPresenter

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/dependabot/pull_request_creator/message_builder/metadata_presenter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dependency:, source:, metadata_finder:, vulnerabilities_fixed:, github_redirection_service:) ⇒ MetadataPresenter

Returns a new instance of MetadataPresenter.



26
27
28
29
30
31
32
33
# File 'lib/dependabot/pull_request_creator/message_builder/metadata_presenter.rb', line 26

def initialize(dependency:, source:, metadata_finder:,
               vulnerabilities_fixed:, github_redirection_service:)
  @dependency = dependency
  @source = source
  @metadata_finder = 
  @vulnerabilities_fixed = vulnerabilities_fixed
  @github_redirection_service = github_redirection_service
end

Instance Attribute Details

#dependencyObject (readonly)

Returns the value of attribute dependency.



11
12
13
# File 'lib/dependabot/pull_request_creator/message_builder/metadata_presenter.rb', line 11

def dependency
  @dependency
end

#github_redirection_serviceObject (readonly)

Returns the value of attribute github_redirection_service.



11
12
13
# File 'lib/dependabot/pull_request_creator/message_builder/metadata_presenter.rb', line 11

def github_redirection_service
  @github_redirection_service
end

#metadata_finderObject (readonly)

Returns the value of attribute metadata_finder.



11
12
13
# File 'lib/dependabot/pull_request_creator/message_builder/metadata_presenter.rb', line 11

def 
  @metadata_finder
end

#sourceObject (readonly)

Returns the value of attribute source.



11
12
13
# File 'lib/dependabot/pull_request_creator/message_builder/metadata_presenter.rb', line 11

def source
  @source
end

#vulnerabilities_fixedObject (readonly)

Returns the value of attribute vulnerabilities_fixed.



11
12
13
# File 'lib/dependabot/pull_request_creator/message_builder/metadata_presenter.rb', line 11

def vulnerabilities_fixed
  @vulnerabilities_fixed
end

Instance Method Details

#to_sObject



35
36
37
38
39
40
41
42
43
44
45
# File 'lib/dependabot/pull_request_creator/message_builder/metadata_presenter.rb', line 35

def to_s
  msg = ""
  msg += vulnerabilities_cascade
  msg += release_cascade
  msg += changelog_cascade
  msg += upgrade_guide_cascade
  msg += commits_cascade
  msg += maintainer_changes_cascade
  msg += break_tag unless msg == ""
  "\n" + sanitize_links_and_mentions(msg, unsafe: true)
end