Exception: GitHub::PullRequest::NotFoundError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/git-process/github_pull_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(base, head, repo, pull_requests_json) ⇒ NotFoundError

Returns a new instance of NotFoundError.



145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# File 'lib/git-process/github_pull_request.rb', line 145

def initialize(base, head, repo, pull_requests_json)
  @base = base
  @head = head
  @repo = repo

  @pull_requests = pull_requests_json.map do |p|
    {:head => p[:head][:ref], :base => p[:base][:ref]}
  end

  msg = "Could not find a pull request for '#{head}' to be merged with '#{base}' on #{repo}."
  msg += "\n\nExisting Pull Requests:"
  msg = pull_requests.inject(msg) { |a, v| "#{a}\n  #{v[:head]} -> #{v[:base]}" }

  super(msg)
end

Instance Attribute Details

#baseObject (readonly)

Returns the value of attribute base.



142
143
144
# File 'lib/git-process/github_pull_request.rb', line 142

def base
  @base
end

#headObject (readonly)

Returns the value of attribute head.



142
143
144
# File 'lib/git-process/github_pull_request.rb', line 142

def head
  @head
end

#repoObject (readonly)

Returns the value of attribute repo.



142
143
144
# File 'lib/git-process/github_pull_request.rb', line 142

def repo
  @repo
end

Instance Method Details

#pull_requestsObject



162
163
164
# File 'lib/git-process/github_pull_request.rb', line 162

def pull_requests
  @pull_requests
end