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.



124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# File 'lib/git-process/github_pull_request.rb', line 124

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.



121
122
123
# File 'lib/git-process/github_pull_request.rb', line 121

def base
  @base
end

#headObject (readonly)

Returns the value of attribute head.



121
122
123
# File 'lib/git-process/github_pull_request.rb', line 121

def head
  @head
end

#repoObject (readonly)

Returns the value of attribute repo.



121
122
123
# File 'lib/git-process/github_pull_request.rb', line 121

def repo
  @repo
end

Instance Method Details

#pull_requestsObject



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

def pull_requests
  @pull_requests
end