Sha256: a6bf0fb7af40f8e86de9d3c47a9b65e29a6fbedbaefb1361db59b5125a0ff28d

Contents?: true

Size: 1.59 KB

Versions: 85

Compression:

Stored size: 1.59 KB

Contents

module Octokit
  class Client

    # Methods for the Legacy Search API
    #
    # @see https://developer.github.com/v3/search/
    module LegacySearch

      # Legacy repository search
      #
      # @see https://developer.github.com/v3/search/#search-repositories
      # @param q [String] Search keyword
      # @return [Array<Sawyer::Resource>] List of repositories found
      def legacy_search_repositories(q, options = {})
        get("legacy/repos/search/#{q}", options)['repositories']
      end

      # Legacy search issues within a repository
      #
      # @param repo [String, Repository, Hash] A GitHub repository
      # @param search_term [String] The term to search for
      # @param state [String] :state (open) <tt>open</tt> or <tt>closed</tt>.
      # @return [Array<Sawyer::Resource>] A list of issues matching the search term and state
      # @example Search for 'test' in the open issues for sferik/rails_admin
      #   Octokit.search_issues("sferik/rails_admin", 'test', 'open')
      def legacy_search_issues(repo, search_term, state='open', options = {})
        get("legacy/issues/search/#{Repository.new(repo)}/#{state}/#{search_term}", options)['issues']
      end

      # Search for user.
      #
      # @param search [String] User to search for.
      # @return [Array<Sawyer::Resource>] Array of hashes representing users.
      # @see https://developer.github.com/v3/search/#search-users
      # @example
      #   Octokit.search_users('pengwynn')
      def legacy_search_users(search, options = {})
        get("legacy/user/search/#{search}", options)['users']
      end
    end
  end
end

Version data entries

85 entries across 66 versions & 3 rubygems

Version Path
octokit-4.12.0 lib/octokit/client/legacy_search.rb
octokit-4.11.0 lib/octokit/client/legacy_search.rb
octokit-4.10.0 lib/octokit/client/legacy_search.rb
tdiary-5.0.9 vendor/bundle/gems/octokit-4.9.0/lib/octokit/client/legacy_search.rb
octokit-4.9.0 lib/octokit/client/legacy_search.rb
tdiary-5.0.8 vendor/bundle/ruby/2.5.0/gems/octokit-4.8.0/lib/octokit/client/legacy_search.rb
tdiary-5.0.8 vendor/bundle/gems/octokit-4.8.0/lib/octokit/client/legacy_search.rb
tdiary-5.0.8 vendor/bundle/gems/tdiary-5.0.7/vendor/bundle/gems/octokit-4.8.0/lib/octokit/client/legacy_search.rb
tdiary-5.0.7 vendor/bundle/gems/octokit-4.8.0/lib/octokit/client/legacy_search.rb
octokit-4.8.0 lib/octokit/client/legacy_search.rb
tdiary-5.0.6 vendor/bundle/gems/octokit-4.7.0/lib/octokit/client/legacy_search.rb
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/octokit-4.6.2/lib/octokit/client/legacy_search.rb
tdiary-5.0.5 vendor/bundle/gems/octokit-4.6.2/lib/octokit/client/legacy_search.rb
tdiary-5.0.5 vendor/bundle/gems/octokit-4.7.0/lib/octokit/client/legacy_search.rb
octokit-4.7.0 lib/octokit/client/legacy_search.rb
octodoggy-4.6.2 lib/octokit/client/legacy_search.rb
tdiary-5.0.4 vendor/bundle/gems/octokit-4.6.2/lib/octokit/client/legacy_search.rb
octokit-4.6.2 lib/octokit/client/legacy_search.rb
octokit-4.6.1 lib/octokit/client/legacy_search.rb
octokit-4.6.0 lib/octokit/client/legacy_search.rb