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
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/octokit-4.19.0/lib/octokit/client/legacy_search.rb
octokit-4.20.0 lib/octokit/client/legacy_search.rb
tdiary-5.1.4 vendor/bundle/ruby/2.7.0/gems/octokit-4.19.0/lib/octokit/client/legacy_search.rb
octokit-4.19.0 lib/octokit/client/legacy_search.rb
tdiary-5.1.3 vendor/bundle/ruby/2.6.0/gems/octokit-4.18.0/lib/octokit/client/legacy_search.rb
tdiary-5.1.3 vendor/bundle/ruby/2.7.0/gems/octokit-4.18.0/lib/octokit/client/legacy_search.rb
tdiary-5.1.2 vendor/bundle/ruby/2.6.0/gems/octokit-4.14.0/lib/octokit/client/legacy_search.rb
tdiary-5.1.2 vendor/bundle/ruby/2.7.0/gems/octokit-4.18.0/lib/octokit/client/legacy_search.rb
octokit-4.18.0 lib/octokit/client/legacy_search.rb
tdiary-5.1.1 vendor/bundle/ruby/2.6.0/gems/octokit-4.14.0/lib/octokit/client/legacy_search.rb
tdiary-5.1.1 vendor/bundle/ruby/2.7.0/gems/octokit-4.16.0/lib/octokit/client/legacy_search.rb
octokit-4.16.0 lib/octokit/client/legacy_search.rb
octokit-4.15.0 lib/octokit/client/legacy_search.rb
tdiary-5.1.0 vendor/bundle/gems/octokit-4.14.0/lib/octokit/client/legacy_search.rb
tdiary-5.0.13 vendor/bundle/gems/octokit-4.13.0/lib/octokit/client/legacy_search.rb
octokit-4.14.0 lib/octokit/client/legacy_search.rb
tdiary-5.0.12.1 vendor/bundle/gems/octokit-4.13.0/lib/octokit/client/legacy_search.rb
tdiary-5.0.11 vendor/bundle/gems/octokit-4.10.0/lib/octokit/client/legacy_search.rb
tdiary-5.0.11 vendor/bundle/gems/octokit-4.13.0/lib/octokit/client/legacy_search.rb
octokit-4.13.0 lib/octokit/client/legacy_search.rb