Skip to content
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
# @example
# Octokit.pull_requests('rails/rails', :state => 'closed')
def pull_requests(*args)
arguments =
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
paginate "#{Repository.path repo}/pulls", opts
def pull_requests(repo, options = {})
paginate "#{Repository.path repo}/pulls", options
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")
# 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 # .pull_requests

context "methods that require a new pull" do

1 comment on commit e48e91f


This comment has been minimized.

Copy link

@killer-lab killer-lab commented on e48e91f Jan 10, 2020


Please sign in to comment.
You can’t perform that action at this time.