Class: Danger::PullRequestFinder

Inherits:
Object
  • Object
show all
Defined in:
lib/danger/ci_source/support/pull_request_finder.rb

Instance Method Summary collapse

Constructor Details

#initialize(specific_pull_request_id, repo_slug = nil, remote: false, git_logs: "", remote_url: "") ⇒ PullRequestFinder

Returns a new instance of PullRequestFinder.



9
10
11
12
13
14
15
# File 'lib/danger/ci_source/support/pull_request_finder.rb', line 9

def initialize(specific_pull_request_id, repo_slug = nil, remote: false, git_logs: "", remote_url: "")
  @specific_pull_request_id = specific_pull_request_id
  @git_logs = git_logs
  @repo_slug = repo_slug
  @remote = to_boolean(remote)
  @remote_url = remote_url
end

Instance Method Details

#call(env: nil) ⇒ Object



17
18
19
20
21
# File 'lib/danger/ci_source/support/pull_request_finder.rb', line 17

def call(env: nil)
  find_pull_request(env).tap do |pull_request|
    raise_pull_request_not_found!(pull_request) unless pull_request.valid?
  end
end