A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/octokit/octokit.rb/commit/e48e91f736d5fce51e3bf74d7c9022aaa52f5c5c below:

Remove long-deprecated positional state overload for listing pulls · octokit/octokit.rb@e48e91f · GitHub

File tree Expand file treeCollapse file tree 2 files changed

+2

-20

lines changed

Filter options

Expand file treeCollapse file tree 2 files changed

+2

-20

lines changed Original file line number Diff line number Diff line change

@@ -12,24 +12,12 @@ module PullRequests

12 12

# @param repo [Integer, String, Hash, Repository] A GitHub repository

13 13

# @param options [Hash] Method options

14 14

# @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

20 15

# @return [Array<Sawyer::Resource>] Array of pulls

21 16

# @see https://developer.github.com/v3/pulls/#list-pull-requests

22 17

# @example

23 18

# 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

33 21

end

34 22

alias :pulls :pull_requests

35 23 Original file line number Diff line number Diff line change

@@ -18,12 +18,6 @@

18 18

expect(pulls).to be_kind_of Array

19 19

assert_requested :get, github_url("/repos/octokit/octokit.rb/pulls?state=open")

20 20

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

27 21

end # .pull_requests

28 22 29 23

context "methods that require a new pull" do

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4