Permalink
Browse files

Remove long-deprecated positional state overload for listing pulls

  • Loading branch information...
pengwynn committed Jun 5, 2015
1 parent fc80aed commit e48e91f736d5fce51e3bf74d7c9022aaa52f5c5c
Showing with 2 additions and 20 deletions.
  1. +2 −14 lib/octokit/client/pull_requests.rb
  2. +0 −6 spec/octokit/client/pull_requests_spec.rb
@@ -12,24 +12,12 @@ module PullRequests
# @param repo [Integer, String, Hash, Repository] A GitHub repository
# @param options [Hash] Method options
# @option options [String] :state `open` or `closed`.
# @overload pull_requests(repo, state, options)
# @deprecated
# @param repo [Integer, String, Hash, Repository] A GitHub repository
# @param state [String] `open` or `closed`.
# @param options [Hash] Method options
# @return [Array<Sawyer::Resource>] Array of pulls
# @see https://developer.github.com/v3/pulls/#list-pull-requests
# @example
# Octokit.pull_requests('rails/rails', :state => 'closed')
def pull_requests(*args)
arguments = Arguments.new(args)
opts = arguments.options
repo = arguments.shift
if state = arguments.shift
octokit_warn "DEPRECATED: Client#pull_requests: Passing state as positional argument is deprecated. Please use :state => '#{state}'"
opts[:state] = state if state
end
paginate "#{Repository.path repo}/pulls", opts
def pull_requests(repo, options = {})
paginate "#{Repository.path repo}/pulls", options
end
alias :pulls :pull_requests
@@ -18,12 +18,6 @@
expect(pulls).to be_kind_of Array
assert_requested :get, github_url("/repos/octokit/octokit.rb/pulls?state=open")
end
# Deprecated
it "lists all pull requests with state argument" do
pulls = @client.pulls("octokit/octokit.rb", 'closed')
expect(pulls).to be_kind_of Array
assert_requested :get, github_url("/repos/octokit/octokit.rb/pulls?state=closed")
end
end # .pull_requests
context "methods that require a new pull" do

0 comments on commit e48e91f

Please sign in to comment.