source stringclasses 1
value | repo stringlengths 5 63 | repo_url stringlengths 24 82 | path stringlengths 5 167 | language stringclasses 1
value | license stringclasses 5
values | stars int64 10 51.4k | ref stringclasses 23
values | size_bytes int64 200 258k | text stringlengths 137 258k |
|---|---|---|---|---|---|---|---|---|---|
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/configurable.rb | Ruby | mit | 3,922 | main | 5,602 | # frozen_string_literal: true
module Octokit
# Configuration options for {Client}, defaulting to values
# in {Default}
module Configurable
# @!attribute [w] access_token
# @see https://developer.github.com/v3/oauth/
# @return [String] OAuth2 access token for authentication
# @!attribute api_e... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/manage_ghes_client.rb | Ruby | mit | 3,922 | main | 1,955 | # frozen_string_literal: true
require 'octokit/configurable'
require 'octokit/connection'
require 'octokit/warnable'
require 'octokit/manage_ghes_client/manage_ghes'
module Octokit
# ManageGHESClient is only meant to be used by GitHub Enterprise Server (GHES) operators
# and provides access to the Manage GHES API... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/gist.rb | Ruby | mit | 3,922 | main | 608 | # frozen_string_literal: true
module Octokit
# Class to parse and create Gist URLs
class Gist
# !@attribute id
# @return [String] Gist ID
attr_accessor :id
# Instantiate {Gist} object from Gist URL
# @ return [Gist]
def self.from_url(url)
Gist.new(URI.parse(url).path[1..])
end
... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/arguments.rb | Ruby | mit | 3,922 | main | 266 | # frozen_string_literal: true
module Octokit
# Extracts options from method arguments
# @private
class Arguments < Array
attr_reader :options
def initialize(args)
@options = args.last.is_a?(::Hash) ? args.pop : {}
super
end
end
end |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/default.rb | Ruby | mit | 3,922 | main | 5,604 | # frozen_string_literal: true
require 'octokit/middleware/follow_redirects'
require 'octokit/response/raise_error'
require 'octokit/response/feed_parser'
require 'octokit/version'
require 'octokit/warnable'
if Gem::Version.new(Faraday::VERSION) >= Gem::Version.new('2.0')
begin
require 'faraday/retry'
rescue L... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client.rb | Ruby | mit | 3,922 | main | 9,256 | # frozen_string_literal: true
require 'octokit/connection'
require 'octokit/warnable'
require 'octokit/arguments'
require 'octokit/repo_arguments'
require 'octokit/configurable'
require 'octokit/authentication'
require 'octokit/gist'
require 'octokit/rate_limit'
require 'octokit/repository'
require 'octokit/user'
requ... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/user.rb | Ruby | mit | 3,922 | main | 422 | # frozen_string_literal: true
module Octokit
# GitHub user class to generate API path urls
class User
# Get the api path for a user
#
# @param user [String, Integer] GitHub user login or id
# @return [String] User Api path
def self.path(user)
case user
when String
"users/#{u... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/error.rb | Ruby | mit | 3,922 | main | 11,617 | # frozen_string_literal: true
module Octokit
# Custom error class for rescuing from all GitHub errors
class Error < StandardError
attr_reader :context
# Returns the appropriate Octokit::Error subclass based
# on status and response message
#
# @param [Hash] response HTTP response
# @return... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/warnable.rb | Ruby | mit | 3,922 | main | 366 | # frozen_string_literal: true
module Octokit
# Allows warnings to be suppressed via environment variable.
module Warnable
module_function
# Wrapper around Kernel#warn to print warnings unless
# OCTOKIT_SILENT is set to true.
#
# @return [nil]
def octokit_warn(*message)
warn message u... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/repository.rb | Ruby | mit | 3,922 | main | 2,716 | # frozen_string_literal: true
module Octokit
# Class to parse GitHub repository owner and name from
# URLs and to generate URLs
class Repository
attr_accessor :owner, :name, :id
NAME_WITH_OWNER_PATTERN = %r{\A[\w.-]+/[\w.-]+\z}i.freeze
# Instantiate from a GitHub repository URL
#
# @return ... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/enterprise_admin_client.rb | Ruby | mit | 3,922 | main | 1,864 | # frozen_string_literal: true
require 'octokit/connection'
require 'octokit/configurable'
require 'octokit/warnable'
require 'octokit/enterprise_admin_client/admin_stats'
require 'octokit/enterprise_admin_client/license'
require 'octokit/enterprise_admin_client/orgs'
require 'octokit/enterprise_admin_client/search_ind... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/rate_limit.rb | Ruby | mit | 3,922 | main | 1,303 | # frozen_string_literal: true
module Octokit
# Class for API Rate Limit info
#
# @!attribute [w] limit
# @return [Integer] Max tries per rate limit period
# @!attribute [w] remaining
# @return [Integer] Remaining tries per rate limit period
# @!attribute [w] resets_at
# @return [Time] Indicates w... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/repo_arguments.rb | Ruby | mit | 3,922 | main | 357 | # frozen_string_literal: true
module Octokit
# Class to extract options from Ruby arguments for
# Repository-related methods
class RepoArguments < Arguments
# !@attribute [r] repo
# @return [Repository]
attr_reader :repo
def initialize(args)
arguments = super
@repo = arguments.shif... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/manage_ghes_client/manage_ghes.rb | Ruby | mit | 3,922 | main | 5,244 | # frozen_string_literal: true
module Octokit
# Client for the Manage GitHub Enterprise Server API
class ManageGHESClient
# Methods for the Manage GitHub Enterprise Server API
#
# @see https://developer.github.com/v3/enterprise-admin/manage-ghes
module ManageAPI
# Get information about the mai... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/response/base_middleware.rb | Ruby | mit | 3,922 | main | 272 | # frozen_string_literal: true
require 'faraday'
module Octokit
module Response
# In Faraday 2.x, Faraday::Response::Middleware was removed
BaseMiddleware = defined?(Faraday::Response::Middleware) ? Faraday::Response::Middleware : Faraday::Middleware
end
end |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/response/raise_error.rb | Ruby | mit | 3,922 | main | 458 | # frozen_string_literal: true
require 'octokit/response/base_middleware'
require 'octokit/error'
module Octokit
# Faraday response middleware
module Response
# This class raises an Octokit-flavored exception based
# HTTP status codes returned by the API
class RaiseError < BaseMiddleware
def on_c... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/response/feed_parser.rb | Ruby | mit | 3,922 | main | 401 | # frozen_string_literal: true
require 'octokit/response/base_middleware'
module Octokit
module Response
# Parses RSS and Atom feed responses.
class FeedParser < BaseMiddleware
def on_complete(env)
if env[:response_headers]['content-type'] =~ /(\batom|\brss)/
require 'rss'
e... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/middleware/follow_redirects.rb | Ruby | mit | 3,922 | main | 4,535 | # frozen_string_literal: true
require 'faraday'
require 'set'
# Adapted from lostisland/faraday_middleware. Trimmed down to just the logic
# that we need for octokit.rb.
#
# https://github.com/lostisland/faraday_middleware/blob/138766e/lib/faraday_middleware/response/follow_redirects.rb
module Octokit
module Middl... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/licenses.rb | Ruby | mit | 3,922 | main | 1,448 | # frozen_string_literal: true
module Octokit
class Client
# Methods for licenses API
#
module Licenses
# List all licenses
#
# @see https://developer.github.com/v3/licenses/#list-all-licenses
# @return [Array<Sawyer::Resource>] A list of licenses
# @example
# Octokit... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/marketplace.rb | Ruby | mit | 3,922 | main | 2,091 | # frozen_string_literal: true
module Octokit
class Client
# Methods for the Marketplace Listing API
#
# @see https://developer.github.com/v3/apps/marketplace/
module Marketplace
# List all plans for an app's marketplace listing
#
# @param options [Hash] A customizable set of options... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/commit_branches.rb | Ruby | mit | 3,922 | main | 705 | # frozen_string_literal: true
module Octokit
class Client
# Methods for the Branches for HEAD API
#
# @see https://developer.github.com/v3/repos/commits/
module CommitBranches
# List branches for a single HEAD commit
#
# @param repo [Integer, String, Hash, Repository] A GitHub repos... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/contents.rb | Ruby | mit | 3,922 | main | 7,709 | # frozen_string_literal: true
module Octokit
class Client
# Methods for the Repo Contents API
#
# @see https://developer.github.com/v3/repos/contents/
module Contents
# Receive the default Readme for a repository
#
# @param repo [Integer, String, Repository, Hash] A GitHub repositor... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/downloads.rb | Ruby | mit | 3,922 | main | 2,127 | # frozen_string_literal: true
module Octokit
class Client
# Methods for the Repo Downloads API
#
# @see https://developer.github.com/v3/repos/downloads/
module Downloads
# List available downloads for a repository
#
# @param repo [Integer, String, Repository, Hash] A Github Reposito... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/projects.rb | Ruby | mit | 3,922 | main | 11,334 | # frozen_string_literal: true
module Octokit
class Client
# Methods for Projects API
#
# @see https://docs.github.com/en/rest/projects
module Projects
# List projects for a repository
#
# Requires authenticated client
#
# @param repo [Integer, String, Repository, Hash] A... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/hooks.rb | Ruby | mit | 3,922 | main | 11,331 | # frozen_string_literal: true
module Octokit
class Client
# Methods for the Hooks API
module Hooks
# List repo hooks
#
# Requires authenticated client.
#
# @param repo [Integer, String, Hash, Repository] A GitHub repository.
# @return [Array<Sawyer::Resource>] Array of has... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/commits.rb | Ruby | mit | 3,922 | main | 11,289 | # frozen_string_literal: true
require 'date'
module Octokit
class Client
# Methods for the Commits API
#
# @see https://developer.github.com/v3/repos/commits/
module Commits
# List commits
#
# @overload commits(repo, sha_or_branch, options = {})
# @deprecated
# @par... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/repository_invitations.rb | Ruby | mit | 3,922 | main | 4,202 | # frozen_string_literal: true
module Octokit
class Client
# Methods for the Repository Invitations API
#
# @see https://developer.github.com/v3/repos/invitations/
module RepositoryInvitations
# Invite a user to a repository
#
# Requires authenticated client
#
# @param re... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/actions_workflow_runs.rb | Ruby | mit | 3,922 | main | 5,660 | # frozen_string_literal: true
module Octokit
class Client
# Methods for the Actions Workflows runs API
#
# @see https://docs.github.com/rest/actions/workflow-runs
module ActionsWorkflowRuns
# List all runs for a repository workflow
#
# @param repo [Integer, String, Repository, Hash]... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/environments.rb | Ruby | mit | 3,922 | main | 3,092 | # frozen_string_literal: true
module Octokit
class Client
# Methods for the Environments API
#
# @see https://docs.github.com/en/rest/deployments/environments
module Environments
# Fetch a single environment for a repository
#
# @param repo [Integer, String, Repository, Hash] A GitH... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/gists.rb | Ruby | mit | 3,922 | main | 8,676 | # frozen_string_literal: true
module Octokit
class Client
# Methods for the Gists API
#
# @see https://developer.github.com/v3/gists/
module Gists
# List gists for a user or all public gists
#
# @param user [String] An optional user to filter listing
# @return [Array<Sawyer::R... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/actions_artifacts.rb | Ruby | mit | 3,922 | main | 2,869 | # frozen_string_literal: true
module Octokit
class Client
# Methods for the Actions Artifacts API
#
# @see https://developer.github.com/v3/actions/artifacts
module ActionsArtifacts
# List all artifacts for a repository
#
# @param repo [Integer, String, Repository, Hash] A GitHub rep... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/actions_workflow_jobs.rb | Ruby | mit | 3,922 | main | 2,793 | # frozen_string_literal: true
module Octokit
class Client
# Methods for the Actions Workflows jobs API
#
# @see https://docs.github.com/rest/actions/workflow-jobs
module ActionsWorkflowJobs
# Get a job for a workflow run
#
# @param repo [Integer, String, Repository, Hash] A GitHub r... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/users.rb | Ruby | mit | 3,922 | main | 18,325 | # frozen_string_literal: true
module Octokit
class Client
# Methods for the Users API
#
# @see https://developer.github.com/v3/users/
module Users
# List all GitHub users
#
# This provides a list of every user, in the order that they signed up
# for GitHub.
#
# @pa... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/say.rb | Ruby | mit | 3,922 | main | 389 | # frozen_string_literal: true
module Octokit
class Client
# Methods for the unpublished Octocat API
module Say
# Return a nifty ASCII Octocat with GitHub wisdom
# or your own
#
# @return [String]
def say(text = nil, options = {})
options[:s] = text if text
get 'o... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/objects.rb | Ruby | mit | 3,922 | main | 6,569 | # frozen_string_literal: true
module Octokit
class Client
# Methods for the Git Data API
#
# @see https://developer.github.com/v3/git/
module Objects
# Get a single tree, fetching information about its root-level objects
#
# Pass <tt>:recursive => true</tt> in <tt>options</tt> to fe... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/issues.rb | Ruby | mit | 3,922 | main | 19,234 | # frozen_string_literal: true
module Octokit
class Client
# Methods for the Issues API
#
# @see https://developer.github.com/v3/issues/
module Issues
# List issues for the authenticated user or repository
#
# @param repository [Integer, String, Repository, Hash] A GitHub repository.... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/notifications.rb | Ruby | mit | 3,922 | main | 7,739 | # frozen_string_literal: true
module Octokit
class Client
# Methods for the Notifications API
#
# @see https://developer.github.com/v3/activity/notifications/
module Notifications
# List your notifications
#
# @param options [Hash] Optional parameters
# @option options [Boolea... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/labels.rb | Ruby | mit | 3,922 | main | 7,655 | # frozen_string_literal: true
require 'erb'
module Octokit
class Client
# Methods for the Issue Labels API
#
# @see https://developer.github.com/v3/issues/labels/
module Labels
# List available labels for a repository
#
# @param repo [Integer, String, Repository, Hash] A GitHub rep... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/reviews.rb | Ruby | mit | 3,922 | main | 10,729 | # frozen_string_literal: true
module Octokit
class Client
# Methods for the Reviews API
#
# @see https://developer.github.com/v3/pulls/reviews/
module Reviews
# List reviews on a pull request
#
# @param repo [Integer, String, Hash, Repository] A GitHub repository
# @param numb... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/pages.rb | Ruby | mit | 3,922 | main | 2,444 | # frozen_string_literal: true
module Octokit
class Client
# Methods for the Pages API
#
# @see https://developer.github.com/v3/repos/pages/
module Pages
# List Pages information for a repository
#
# @param repo [Integer, String, Repository, Hash] A GitHub repository
# @return ... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/meta.rb | Ruby | mit | 3,922 | main | 531 | # frozen_string_literal: true
module Octokit
class Client
# Methods for the Meta API
#
# @see https://developer.github.com/v3/meta/
module Meta
# Get meta information about GitHub.com, the service.
# @see https://developer.github.com/v3/meta/#meta
# @return [Sawyer::Resource] Hash w... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/pull_requests.rb | Ruby | mit | 3,922 | main | 15,558 | # frozen_string_literal: true
module Octokit
class Client
# Methods for the Pull Requests API
#
# @see https://developer.github.com/v3/pulls/
module PullRequests
# List pull requests for a repository
#
# @overload pull_requests(repo, options)
# @param repo [Integer, String, ... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/actions_secrets.rb | Ruby | mit | 3,922 | main | 7,028 | # frozen_string_literal: true
module Octokit
class Client
# Methods for the Actions Secrets API
#
# @see https://developer.github.com/v3/actions/secrets/
module ActionsSecrets
# Get public key for secrets encryption
#
# @param repo [Integer, String, Hash, Repository] A GitHub reposi... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/service_status.rb | Ruby | mit | 3,922 | main | 1,530 | # frozen_string_literal: true
module Octokit
class Client
# Methods for the GitHub Status API
#
# @see https://status.github.com/api
module ServiceStatus
# Root for status API
# @private
SUMMARY_ROOT = 'https://www.githubstatus.com/api/v2/summary.json'
STATUS_ROOT = 'ht... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/community_profile.rb | Ruby | mit | 3,922 | main | 765 | # frozen_string_literal: true
module Octokit
class Client
# Methods for the Community Profile API
#
# @see https://developer.github.com/v3/repos/community/
module CommunityProfile
# Get community profile metrics for a repository
#
# @param repo [Integer, String, Hash, Repository] A ... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/organizations.rb | Ruby | mit | 3,922 | main | 37,449 | # frozen_string_literal: true
module Octokit
class Client
# Methods for the Organizations API
#
# @see https://developer.github.com/v3/orgs/
module Organizations
# Get an organization
#
# @param org [String, Integer] Organization GitHub login or id.
# @return [Sawyer::Resource... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/deployments.rb | Ruby | mit | 3,922 | main | 4,159 | # frozen_string_literal: true
module Octokit
class Client
# Methods for the Deployments API
#
# @see https://developer.github.com/v3/repos/commits/deployments/
module Deployments
# Fetch a single deployment for a repository
#
# @param repo [Integer, String, Repository, Hash] A GitHu... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/gitignore.rb | Ruby | mit | 3,922 | main | 1,381 | # frozen_string_literal: true
module Octokit
class Client
# Methods for the Gitignore API
#
# @see https://developer.github.com/v3/gitignore/
module Gitignore
# Listing available gitignore templates.
#
# These templates can be passed option when creating a repository.
#
... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/stats.rb | Ruby | mit | 3,922 | main | 5,362 | # frozen_string_literal: true
module Octokit
class Client
# Methods for the Repository Statistics API
#
# @see https://developer.github.com/v3/repos/statistics/
module Stats
# Get contributors list with additions, deletions, and commit counts
#
# @param repo [Integer, String, Hash, ... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/events.rb | Ruby | mit | 3,922 | main | 6,705 | # frozen_string_literal: true
module Octokit
class Client
# Method for the Events API
#
# @see https://developer.github.com/v3/activity/events/
# @see https://developer.github.com/v3/issues/events/
module Events
# List all public events for GitHub
#
# @return [Array<Sawyer::Reso... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/tokens.rb | Ruby | mit | 3,922 | main | 934 | # frozen_string_literal: true
module Octokit
class Client
# Method to check scopes
#
# @see https://developer.github.com/v3/oauth_authorizations/#oauth-authorizations-api
module Tokens
# Check scopes for a token
#
# @param token [String] GitHub OAuth token
# @param options [Ha... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/traffic.rb | Ruby | mit | 3,922 | main | 2,516 | # frozen_string_literal: true
module Octokit
class Client
# Methods for the Traffic API
#
# @see https://developer.github.com/v3/repos/traffic/
module Traffic
# Get the top 10 referrers over the last 14 days
#
# @param repo [Integer, String, Repository, Hash] A GitHub repository
... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/oauth_applications.rb | Ruby | mit | 3,922 | main | 4,365 | # frozen_string_literal: true
module Octokit
class Client
# Methods for the OauthApplications API
#
# @see https://developer.github.com/v3/apps/oauth_applications
module OauthApplications
# Check if a token is valid.
#
# Applications can check if a token is valid without rate limits... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/checks.rb | Ruby | mit | 3,922 | main | 10,125 | # frozen_string_literal: true
module Octokit
class Client
# Methods for the Checks API
#
# @see https://developer.github.com/v3/checks/
module Checks
# Methods for Check Runs
#
# @see https://developer.github.com/v3/checks/runs/
# Create a check run
#
# @param rep... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/milestones.rb | Ruby | mit | 3,922 | main | 4,578 | # frozen_string_literal: true
module Octokit
class Client
# Methods for the Issues Milestones API
#
# @see https://developer.github.com/v3/issues/milestones/
module Milestones
# List milestones for a repository
#
# @param repository [Integer, String, Repository, Hash] A GitHub repos... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/feeds.rb | Ruby | mit | 3,922 | main | 854 | # frozen_string_literal: true
module Octokit
class Client
# Methods for the Feeds API
#
# @see https://developer.github.com/v3/activity/feeds/
module Feeds
# List Feeds
#
# The feeds returned depend on authentication, see the GitHub API docs
# for more information.
#
... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/codespaces_secrets.rb | Ruby | mit | 3,922 | main | 4,815 | # frozen_string_literal: true
module Octokit
class Client
# Methods for the Codespaces Secrets API
#
# @see https://docs.github.com/en/rest/codespaces/
module CodespacesSecrets
# Get public key for secrets encryption
#
# @param repo [Integer, String, Hash, Repository] A GitHub repos... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/rate_limit.rb | Ruby | mit | 3,922 | main | 1,823 | # frozen_string_literal: true
module Octokit
class Client
# Methods for API rate limiting info
#
# @see https://developer.github.com/v3/#rate-limiting
module RateLimit
# Get rate limit info from last response if available
# or make a new request to fetch rate limit
#
# @see ht... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/apps.rb | Ruby | mit | 3,922 | main | 8,898 | # frozen_string_literal: true
module Octokit
class Client
# Methods for the Apps API
module Apps
# Get the authenticated App
#
# @param options [Hash] A customizable set of options
#
# @see https://docs.github.com/en/rest/apps/apps#get-the-authenticated-app
#
# @retu... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/markdown.rb | Ruby | mit | 3,922 | main | 937 | # frozen_string_literal: true
module Octokit
class Client
# Methods for the Markdown API
#
# @see https://developer.github.com/v3/markdown/
module Markdown
# Render an arbitrary Markdown document
#
# @param text [String] Markdown source
# @option options [String] (optional) :m... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/source_import.rb | Ruby | mit | 3,922 | main | 7,810 | # frozen_string_literal: true
module Octokit
class Client
# Methods for the Source Import API
#
# @see https://developer.github.com/v3/migration/source_imports
module SourceImport
# Start a source import to a GitHub repository using GitHub Importer.
#
# @overload start_source_import... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/search.rb | Ruby | mit | 3,922 | main | 4,306 | # frozen_string_literal: true
module Octokit
class Client
# Methods for the Search API
#
# @see https://developer.github.com/v3/search/
module Search
# Search code
#
# @param query [String] Search term and qualifiers
# @param options [Hash] Sort and pagination options
# ... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/emojis.rb | Ruby | mit | 3,922 | main | 432 | # frozen_string_literal: true
module Octokit
class Client
# Methods for the Emojis API
module Emojis
# List all emojis used on GitHub
#
# @return [Sawyer::Resource] A list of all emojis on GitHub
# @see https://developer.github.com/v3/emojis/#emojis
# @example List all emojis
... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/legacy_search.rb | Ruby | mit | 3,922 | main | 1,662 | # frozen_string_literal: true
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... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/reactions.rb | Ruby | mit | 3,922 | main | 9,493 | # frozen_string_literal: true
module Octokit
class Client
# Methods for the Reacions API
#
# @see https://developer.github.com/v3/reactions/
module Reactions
# List reactions for a commit comment
#
# @param repo [Integer, String, Hash, Repository] A GitHub repository
# @param ... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/actions_workflows.rb | Ruby | mit | 3,922 | main | 2,868 | # frozen_string_literal: true
module Octokit
class Client
# Methods for the Actions Workflows API
#
# @see https://developer.github.com/v3/actions/workflows
module ActionsWorkflows
# Get the workflows in a repository
#
# @param repo [Integer, String, Repository, Hash] A GitHub repos... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/dependabot_secrets.rb | Ruby | mit | 3,922 | main | 4,815 | # frozen_string_literal: true
module Octokit
class Client
# Methods for the dependabot Secrets API
#
# @see https://docs.github.com/en/rest/dependabot/
module DependabotSecrets
# Get public key for secrets encryption
#
# @param repo [Integer, String, Hash, Repository] A GitHub repos... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/statuses.rb | Ruby | mit | 3,922 | main | 2,048 | # frozen_string_literal: true
module Octokit
class Client
# Methods for the Commit Statuses API
#
# @see https://developer.github.com/v3/repos/statuses/
module Statuses
# List all statuses for a given commit
#
# @param repo [Integer, String, Repository, Hash] A GitHub repository
... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/releases.rb | Ruby | mit | 3,922 | main | 6,941 | # frozen_string_literal: true
module Octokit
class Client
# Methods for the Releases API
#
# @see https://developer.github.com/v3/repos/releases/
module Releases
# List releases for a repository
#
# @param repo [Integer, String, Repository, Hash] A GitHub repository
# @return ... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/commit_comments.rb | Ruby | mit | 3,922 | main | 4,106 | # frozen_string_literal: true
module Octokit
class Client
# Methods for the Commit Comments API
#
# @see https://developer.github.com/v3/repos/comments/
module CommitComments
# List all commit comments
#
# @param repo [Integer, String, Hash, Repository] A GitHub repository
# @... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/repositories.rb | Ruby | mit | 3,922 | main | 37,565 | # frozen_string_literal: true
module Octokit
class Client
# Methods for the Repositories API
#
# @see https://developer.github.com/v3/repos/
module Repositories
# Check if a repository exists
#
# @see https://developer.github.com/v3/repos/#get
# @param repo [Integer, String, H... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/refs.rb | Ruby | mit | 3,922 | main | 6,551 | # frozen_string_literal: true
module Octokit
class Client
# Methods for References for Git Data API
#
# @see https://developer.github.com/v3/git/refs/
module Refs
# List all refs for a given user and repo
#
# @param repo [Integer, String, Repository, Hash] A GitHub repository
... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/code_scanning.rb | Ruby | mit | 3,922 | main | 8,769 | # frozen_string_literal: true
require 'tempfile'
require 'zlib'
module Octokit
class Client
# Methods for the code scanning alerts API
#
# @see https://docs.github.com/rest/code-scanning
module CodeScanning
# Updates a code scanning default setup configuration
#
# @param repo [Inte... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/client/commit_pulls.rb | Ruby | mit | 3,922 | main | 686 | # frozen_string_literal: true
module Octokit
class Client
# Methods for the Commit Pulls API
#
# @see https://developer.github.com/v3/repos/comments/
module CommitPulls
# List pulls for a single commit
#
# @param repo [Integer, String, Hash, Repository] A GitHub repository
# @... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/enterprise_admin_client/search_indexing.rb | Ruby | mit | 3,922 | main | 2,992 | # frozen_string_literal: true
module Octokit
class EnterpriseAdminClient
# Methods for the Enterprise Search Indexing API
#
# @see https://developer.github.com/v3/enterprise-admin/search_indexing/
module SearchIndexing
# Queue a User or Organization to be indexed
#
# @param user [St... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/enterprise_admin_client/orgs.rb | Ruby | mit | 3,922 | main | 938 | # frozen_string_literal: true
module Octokit
class EnterpriseAdminClient
# Methods for the Enterprise Orgs API
#
# @see https://developer.github.com/v3/enterprise-admin/orgs/
module Orgs
# Create a new organization on the instance.
#
# @param login [String] The organization's userna... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/enterprise_admin_client/admin_stats.rb | Ruby | mit | 3,922 | main | 3,458 | # frozen_string_literal: true
module Octokit
class EnterpriseAdminClient
# Methods for the Enterprise Admin Stats API
#
# @see https://developer.github.com/v3/enterprise-admin/admin_stats/
module AdminStats
# Get all available stats
#
# @return [Sawyer::Resource] All available stats... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/enterprise_admin_client/users.rb | Ruby | mit | 3,922 | main | 5,173 | # frozen_string_literal: true
module Octokit
class EnterpriseAdminClient
# Methods for the Enterprise User Administration API
#
# @see https://developer.github.com/enterprise/v3/enterprise-admin/users/
module Users
# Create a new user.
#
# @param login [String] The user's username.
... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | lib/octokit/enterprise_admin_client/license.rb | Ruby | mit | 3,922 | main | 428 | # frozen_string_literal: true
module Octokit
class EnterpriseAdminClient
# Methods for the Enterprise License API
#
# @see https://developer.github.com/v3/enterprise-admin/license/
module License
# Get information about the Enterprise license
#
# @return [Sawyer::Resource] The licen... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | yard/default/layout/html/setup.rb | Ruby | mit | 3,922 | main | 659 | # frozen_string_literal: true
def diskfile
@file.attributes[:markup] ||= markup_for_file('', @file.filename)
data = htmlify(@file.contents, @file.attributes[:markup])
# Hack our way to working hash anchors for the README.
# GitHub generates header links as #some-thing and YARD
# generates them as #Some_thin... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | spec/octokit_spec.rb | Ruby | mit | 3,922 | main | 1,873 | # frozen_string_literal: true
describe Octokit do
before do
Octokit.reset!
end
after do
Octokit.reset!
end
it 'sets defaults' do
# rubocop:disable Style/HashEachMethods
#
# This may look like a `.keys.each` which should be replaced with `#each_key`, but
# this doesn't actually work,... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | spec/spec_helper.rb | Ruby | mit | 3,922 | main | 10,155 | # frozen_string_literal: true
if RUBY_ENGINE == 'ruby'
require 'simplecov'
SimpleCov.start
end
require 'json'
require 'octokit'
require 'rspec'
require 'webmock/rspec'
require 'base64'
require 'jwt'
# latest version of pry-byebug is not compatible with Ruby 3.2.0
if Gem::Version.new(RUBY_VERSION) < Gem::Version.n... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | spec/octokit/organization_spec.rb | Ruby | mit | 3,922 | main | 509 | # frozen_string_literal: true
describe Octokit::Organization do
describe '.path' do
context 'with name' do
it 'returns name api path' do
path = Octokit::Organization.path 'octokit'
expect(path).to eq 'orgs/octokit'
end
end # with login
context 'with id' do
it 'returns i... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | spec/octokit/gist_spec.rb | Ruby | mit | 3,922 | main | 979 | # frozen_string_literal: true
describe Octokit::Gist do
context 'when given a URL' do
it 'sets the id' do
gist = Octokit::Gist.from_url('https://gist.github.com/12345')
expect(gist.id).to eq('12345')
end
end
context 'when passed a string ID' do
before do
@gist = Octokit::Gist.new('... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | spec/octokit/rate_limit_spec.rb | Ruby | mit | 3,922 | main | 1,829 | # frozen_string_literal: true
require 'octokit/rate_limit'
describe Octokit::RateLimit do
describe '.from_response' do
let(:response_headers) do
{
'X-RateLimit-Limit' => 60,
'X-RateLimit-Remaining' => 42,
'X-RateLimit-Reset' => (Time.now + 60).to_i
}
end
let(:respons... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | spec/octokit/ghes_manage_spec.rb | Ruby | mit | 3,922 | main | 258 | # frozen_string_literal: true
describe Octokit::ManageGHESClient do
describe 'module configuration' do
it 'inherits Octokit::Client' do
manage_ghes = Octokit::ManageGHESClient.new
expect manage_ghes.is_a? Octokit::Client
end
end
end |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | spec/octokit/repository_spec.rb | Ruby | mit | 3,922 | main | 7,768 | # frozen_string_literal: true
describe Octokit::Repository do
context 'when passed a string containg a slash' do
before do
@repository = Octokit::Repository.new('sferik/octokit')
end
it 'sets the repository name and username' do
expect(@repository.name).to eq('octokit')
expect(@reposit... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | spec/octokit/error_spec.rb | Ruby | mit | 3,922 | main | 1,335 | # frozen_string_literal: true
require 'octokit/error'
# I have mixed feelings about testing this method due to potentially breaking encapsulation but
# given the nature of this method and the fact that it is meant to keep secrets out of logs.
# In this case, it is worth it and will help us know if something changes i... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | spec/octokit/client_spec.rb | Ruby | mit | 3,922 | main | 48,299 | # frozen_string_literal: true
require 'json'
describe Octokit::Client do
before do
Octokit.reset!
end
after do
Octokit.reset!
end
describe 'module configuration' do
before do
Octokit.reset!
Octokit.configure do |config|
# rubocop:disable Style/HashEachMethods
#
... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | spec/octokit/user_spec.rb | Ruby | mit | 3,922 | main | 625 | # frozen_string_literal: true
describe Octokit::User do
describe '.path' do
context 'with no user passed' do
it 'returns default path' do
path = Octokit::User.path nil
expect(path).to eq 'user'
end
end
context 'with login' do
it 'returns login api path' do
path ... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | spec/octokit/enterprise_admin_client_spec.rb | Ruby | mit | 3,922 | main | 1,109 | # frozen_string_literal: true
describe Octokit::EnterpriseAdminClient do
describe 'module configuration' do
it 'inherits Octokit::Client' do
admin_client = Octokit::EnterpriseAdminClient.new
expect admin_client.is_a? Octokit::Client
end
describe 'with .netrc' do
before do
File.... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | spec/octokit/ghes_manage_client/ghes_manage_spec.rb | Ruby | mit | 3,922 | main | 4,956 | # frozen_string_literal: true
describe Octokit::ManageGHESClient::ManageAPI do
before do
Octokit.reset!
@manage_ghes = manage_ghes_client
@license = 'spec/fixtures/github-enterprise.ghl'
end
describe '.maintenance_mode', :vcr do
it 'get maintenance mode' do
@manage_ghes.maintenance_mode
... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | spec/octokit/client/downloads_spec.rb | Ruby | mit | 3,922 | main | 1,031 | # frozen_string_literal: true
describe Octokit::Client::Downloads do
before do
Octokit.reset!
@client = oauth_client
end
describe '.downloads', :vcr do
it 'lists available downloads' do
downloads = @client.downloads('github/hubot')
expect(downloads.last.description).to eq('Version 1.0.0 ... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | spec/octokit/client/contents_spec.rb | Ruby | mit | 3,922 | main | 7,323 | # frozen_string_literal: true
require 'tempfile'
describe Octokit::Client::Contents do
before do
Octokit.reset!
@client = oauth_client
end
describe '.readme', :vcr do
it 'returns the default readme' do
readme = @client.readme('octokit/octokit.rb')
expect(readme.encoding).to eq('base64')... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | spec/octokit/client/projects_spec.rb | Ruby | mit | 3,922 | main | 7,343 | # frozen_string_literal: true
describe Octokit::Client::Projects do
describe '.projects', :vcr do
it 'returns a list of projects for a repository' do
projects = oauth_client.projects('octokit/octokit.rb')
expect(projects).to be_kind_of Array
assert_requested :get, github_url('/repos/octokit/oct... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | spec/octokit/client/gitignore_spec.rb | Ruby | mit | 3,922 | main | 740 | # frozen_string_literal: true
describe Octokit::Client::Gitignore do
before do
@client = oauth_client
end
describe '.gitignore_templates', :vcr do
it 'returns all gitignore templates' do
templates = @client.gitignore_templates
expect(templates).to be_kind_of Array
assert_requested :get... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | spec/octokit/client/commit_comments_spec.rb | Ruby | mit | 3,922 | main | 2,658 | # frozen_string_literal: true
describe Octokit::Client::CommitComments do
before do
@client = oauth_client
end
describe '.list_commit_comments', :vcr do
it 'returns a list of all commit comments' do
commit_comments = @client.list_commit_comments('sferik/rails_admin')
expect(commit_comments.f... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | spec/octokit/client/actions_artifacts_spec.rb | Ruby | mit | 3,922 | main | 2,543 | # frozen_string_literal: true
describe Octokit::Client::ActionsArtifacts, :vcr do
before do
Octokit.reset!
@client = oauth_client
@workflow_run_id = 3_049_298_023
@artifact_id = 362_518_594
end
after do
Octokit.reset!
end
describe '.repository_artifacts' do
it 'returns all artifacts... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | spec/octokit/client/statuses_spec.rb | Ruby | mit | 3,922 | main | 1,425 | # frozen_string_literal: true
describe Octokit::Client::Statuses do
before do
@client = oauth_client
end
describe '.statuses', :vcr do
it 'lists commit statuses' do
statuses = Octokit.statuses('octokit/octokit.rb', '7d069dedd4cb56bf57760688657abd0e6b5a28b8')
expect(statuses).to be_kind_of Ar... |
github | octokit/octokit.rb | https://github.com/octokit/octokit.rb | spec/octokit/client/reviews_spec.rb | Ruby | mit | 3,922 | main | 10,438 | # frozen_string_literal: true
require 'securerandom'
describe Octokit::Client::Reviews do
before do
Octokit.reset!
@client = oauth_client
end
describe '.pull_request_reviews', :vcr do
let(:test_pr) { 841 }
it 'returns a list of all pull request reviews' do
reviews = @client.pull_request_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.