Skip to content

Commit e48e91f

Browse files
committed
Remove long-deprecated positional state overload for listing pulls
1 parent fc80aed commit e48e91f

File tree

2 files changed

+2
-20
lines changed

2 files changed

+2
-20
lines changed

lib/octokit/client/pull_requests.rb

+2-14
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,12 @@ module PullRequests
1212
# @param repo [Integer, String, Hash, Repository] A GitHub repository
1313
# @param options [Hash] Method options
1414
# @option options [String] :state `open` or `closed`.
15-
# @overload pull_requests(repo, state, options)
16-
# @deprecated
17-
# @param repo [Integer, String, Hash, Repository] A GitHub repository
18-
# @param state [String] `open` or `closed`.
19-
# @param options [Hash] Method options
2015
# @return [Array<Sawyer::Resource>] Array of pulls
2116
# @see https://developer.github.com/v3/pulls/#list-pull-requests
2217
# @example
2318
# Octokit.pull_requests('rails/rails', :state => 'closed')
24-
def pull_requests(*args)
25-
arguments = Arguments.new(args)
26-
opts = arguments.options
27-
repo = arguments.shift
28-
if state = arguments.shift
29-
octokit_warn "DEPRECATED: Client#pull_requests: Passing state as positional argument is deprecated. Please use :state => '#{state}'"
30-
opts[:state] = state if state
31-
end
32-
paginate "#{Repository.path repo}/pulls", opts
19+
def pull_requests(repo, options = {})
20+
paginate "#{Repository.path repo}/pulls", options
3321
end
3422
alias :pulls :pull_requests
3523

spec/octokit/client/pull_requests_spec.rb

-6
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@
1818
expect(pulls).to be_kind_of Array
1919
assert_requested :get, github_url("/repos/octokit/octokit.rb/pulls?state=open")
2020
end
21-
# Deprecated
22-
it "lists all pull requests with state argument" do
23-
pulls = @client.pulls("octokit/octokit.rb", 'closed')
24-
expect(pulls).to be_kind_of Array
25-
assert_requested :get, github_url("/repos/octokit/octokit.rb/pulls?state=closed")
26-
end
2721
end # .pull_requests
2822

2923
context "methods that require a new pull" do

0 commit comments

Comments
 (0)