class Dependabot::PullRequest

Attributes

base[R]
dependency[R]
head[R]
nwo[R]

Public Class Methods

new(nwo:, base:, head:, dependency:) click to toggle source
# File lib/dependabot/pull_request.rb, line 9
def initialize(nwo:, base:, head:, dependency:)
  @nwo = nwo
  @base = base
  @head = head
  @dependency = dependency
end

Public Instance Methods

commit_message() click to toggle source
# File lib/dependabot/pull_request.rb, line 16
    def commit_message
      memoize(:commit_message) do
        <<~COMMIT
          #{title}

          #{description}
        COMMIT
      end
    end
run_against(api) click to toggle source
# File lib/dependabot/pull_request.rb, line 26
def run_against(api)
  api.create_pull_request(nwo, base, head, title, description)
end

Private Instance Methods

description() click to toggle source
# File lib/dependabot/pull_request.rb, line 40
def description
  memoize(:description) do
    ERB
      .new(File.read(File.join(__dir__, "templates/pull.md.erb")))
      .result(binding)
  end
end
title() click to toggle source
# File lib/dependabot/pull_request.rb, line 34
def title
  memoize(:title) do
    "chore(deps): bump #{dependency.name} from #{dependency.version}"
  end
end