Module: Octokit::Client::LegacySearch

Included in:
Octokit::Client
Defined in:
lib/octokit/client/legacy_search.rb

Overview

Methods for the Legacy Search API

Instance Method Summary collapse

Instance Method Details

#legacy_search_issues(repo, search_term, state = 'open', options = {}) ⇒ Array<Sawyer::Resource>

Legacy search issues within a repository

Examples:

Search for ‘test’ in the open issues for sferik/rails_admin

Octokit.search_issues("sferik/rails_admin", 'test', 'open')

Parameters:

  • repo (String, Repository, Hash)

    A GitHub repository

  • search_term (String)

    The term to search for

  • state (String) (defaults to: 'open')

    :state (open) open or closed.

Returns:

  • (Array<Sawyer::Resource>)

    A list of issues matching the search term and state



26
27
28
# File 'lib/octokit/client/legacy_search.rb', line 26

def legacy_search_issues(repo, search_term, state='open', options = {})
  get("legacy/issues/search/#{Repository.new(repo)}/#{state}/#{search_term}", options)['issues']
end

#legacy_search_repositories(q, options = {}) ⇒ Array<Sawyer::Resource>

Legacy repository search

Parameters:

  • q (String)

    Search keyword

Returns:

  • (Array<Sawyer::Resource>)

    List of repositories found

See Also:



14
15
16
# File 'lib/octokit/client/legacy_search.rb', line 14

def legacy_search_repositories(q, options = {})
  get("legacy/repos/search/#{q}", options)['repositories']
end

#legacy_search_users(search, options = {}) ⇒ Array<Sawyer::Resource>

Search for user.

Examples:

Octokit.search_users('pengwynn')

Parameters:

  • search (String)

    User to search for.

Returns:

  • (Array<Sawyer::Resource>)

    Array of hashes representing users.

See Also:



37
38
39
# File 'lib/octokit/client/legacy_search.rb', line 37

def legacy_search_users(search, options = {})
  get("legacy/user/search/#{search}", options)['users']
end