Skip to content

Commit

Permalink
Remove long-deprecated positional state overload for listing pulls
Browse files Browse the repository at this point in the history
  • Loading branch information
pengwynn committed Jun 5, 2015
1 parent fc80aed commit e48e91f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
16 changes: 2 additions & 14 deletions lib/octokit/client/pull_requests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 0 additions & 6 deletions spec/octokit/client/pull_requests_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

1 comment on commit e48e91f

@killer-lab
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Damn

Please sign in to comment.