repo stringlengths 5 92 | file_url stringlengths 80 287 | file_path stringlengths 5 197 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:37:27 2026-01-04 17:58:21 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
fnando/i18n-js | https://github.com/fnando/i18n-js/blob/f8fb0dc0b01e7e639a6eb5dd875adbaa78858d8f/lib/i18n-js/schema.rb | lib/i18n-js/schema.rb | # frozen_string_literal: true
module I18nJS
class Schema
InvalidError = Class.new(StandardError)
REQUIRED_LINT_TRANSLATIONS_KEYS = %i[ignore].freeze
REQUIRED_LINT_SCRIPTS_KEYS = %i[ignore patterns].freeze
REQUIRED_TRANSLATION_KEYS = %i[file patterns].freeze
TRANSLATION_KEYS = %i[file patterns].f... | ruby | MIT | f8fb0dc0b01e7e639a6eb5dd875adbaa78858d8f | 2026-01-04T15:48:46.154368Z | false |
fnando/i18n-js | https://github.com/fnando/i18n-js/blob/f8fb0dc0b01e7e639a6eb5dd875adbaa78858d8f/lib/i18n-js/cli/command.rb | lib/i18n-js/cli/command.rb | # frozen_string_literal: true
module I18nJS
class CLI
class Command
attr_reader :ui, :argv
def self.command_name(name)
define_method(:name) { name }
end
def self.description(description)
define_method(:description) { description }
end
def self.parse(&block)
... | ruby | MIT | f8fb0dc0b01e7e639a6eb5dd875adbaa78858d8f | 2026-01-04T15:48:46.154368Z | false |
fnando/i18n-js | https://github.com/fnando/i18n-js/blob/f8fb0dc0b01e7e639a6eb5dd875adbaa78858d8f/lib/i18n-js/cli/ui.rb | lib/i18n-js/cli/ui.rb | # frozen_string_literal: true
module I18nJS
class CLI
class UI
attr_reader :stdout, :stderr
attr_accessor :colored
def initialize(stdout:, stderr:, colored: nil)
@stdout = stdout
@stderr = stderr
@colored = colored
end
def stdout_print(*message)
std... | ruby | MIT | f8fb0dc0b01e7e639a6eb5dd875adbaa78858d8f | 2026-01-04T15:48:46.154368Z | false |
fnando/i18n-js | https://github.com/fnando/i18n-js/blob/f8fb0dc0b01e7e639a6eb5dd875adbaa78858d8f/lib/i18n-js/cli/plugins_command.rb | lib/i18n-js/cli/plugins_command.rb | # frozen_string_literal: true
module I18nJS
class CLI
class PluginsCommand < Command
command_name "plugins"
description "List plugins that will be activated"
parse do |opts|
opts.banner = "Usage: i18n #{name} [options]"
opts.on(
"-rREQUIRE_FILE",
"--require... | ruby | MIT | f8fb0dc0b01e7e639a6eb5dd875adbaa78858d8f | 2026-01-04T15:48:46.154368Z | false |
fnando/i18n-js | https://github.com/fnando/i18n-js/blob/f8fb0dc0b01e7e639a6eb5dd875adbaa78858d8f/lib/i18n-js/cli/check_command.rb | lib/i18n-js/cli/check_command.rb | # frozen_string_literal: true
module I18nJS
class CLI
class CheckCommand < LintTranslationsCommand
command_name "check"
description "Check for missing translations based on the default " \
"locale (DEPRECATED: Use `i18n lint:translations` instead)"
def command
ui.stde... | ruby | MIT | f8fb0dc0b01e7e639a6eb5dd875adbaa78858d8f | 2026-01-04T15:48:46.154368Z | false |
fnando/i18n-js | https://github.com/fnando/i18n-js/blob/f8fb0dc0b01e7e639a6eb5dd875adbaa78858d8f/lib/i18n-js/cli/init_command.rb | lib/i18n-js/cli/init_command.rb | # frozen_string_literal: true
module I18nJS
class CLI
class InitCommand < Command
command_name "init"
description "Initialize a project"
parse do |opts|
opts.banner = "Usage: i18n #{name} [options]"
opts.on(
"-cCONFIG_FILE",
"--config=CONFIG_FILE",
... | ruby | MIT | f8fb0dc0b01e7e639a6eb5dd875adbaa78858d8f | 2026-01-04T15:48:46.154368Z | false |
fnando/i18n-js | https://github.com/fnando/i18n-js/blob/f8fb0dc0b01e7e639a6eb5dd875adbaa78858d8f/lib/i18n-js/cli/export_command.rb | lib/i18n-js/cli/export_command.rb | # frozen_string_literal: true
module I18nJS
class CLI
class ExportCommand < Command
command_name "export"
description "Export translations as JSON files"
parse do |opts|
opts.banner = "Usage: i18n #{name} [options]"
opts.on(
"-cCONFIG_FILE",
"--config=CONFI... | ruby | MIT | f8fb0dc0b01e7e639a6eb5dd875adbaa78858d8f | 2026-01-04T15:48:46.154368Z | false |
fnando/i18n-js | https://github.com/fnando/i18n-js/blob/f8fb0dc0b01e7e639a6eb5dd875adbaa78858d8f/lib/i18n-js/cli/lint_translations_command.rb | lib/i18n-js/cli/lint_translations_command.rb | # frozen_string_literal: true
module I18nJS
class CLI
class LintTranslationsCommand < Command
command_name "lint:translations"
description "Check for missing translations based on the default locale"
parse do |opts|
opts.banner = "Usage: i18n #{name} [options]"
opts.on(
... | ruby | MIT | f8fb0dc0b01e7e639a6eb5dd875adbaa78858d8f | 2026-01-04T15:48:46.154368Z | false |
fnando/i18n-js | https://github.com/fnando/i18n-js/blob/f8fb0dc0b01e7e639a6eb5dd875adbaa78858d8f/lib/i18n-js/cli/lint_scripts_command.rb | lib/i18n-js/cli/lint_scripts_command.rb | # frozen_string_literal: true
module I18nJS
class CLI
class LintScriptsCommand < Command
command_name "lint:scripts"
description "Lint files using TypeScript"
parse do |opts|
opts.banner = "Usage: i18n #{name} [options]"
opts.on(
"-cCONFIG_FILE",
"--config=... | ruby | MIT | f8fb0dc0b01e7e639a6eb5dd875adbaa78858d8f | 2026-01-04T15:48:46.154368Z | false |
fnando/i18n-js | https://github.com/fnando/i18n-js/blob/f8fb0dc0b01e7e639a6eb5dd875adbaa78858d8f/lib/i18n-js/cli/version_command.rb | lib/i18n-js/cli/version_command.rb | # frozen_string_literal: true
module I18nJS
class CLI
class VersionCommand < Command
command_name "version"
description "Show package version"
parse do |opts|
opts.banner = "Usage: i18n #{name}"
opts.on_tail do
ui.exit_with("v#{I18nJS::VERSION}")
end
en... | ruby | MIT | f8fb0dc0b01e7e639a6eb5dd875adbaa78858d8f | 2026-01-04T15:48:46.154368Z | false |
fnando/i18n-js | https://github.com/fnando/i18n-js/blob/f8fb0dc0b01e7e639a6eb5dd875adbaa78858d8f/lib/guard/i18n-js.rb | lib/guard/i18n-js.rb | # frozen_string_literal: true
gem "guard"
gem "guard-compat"
require "guard/compat/plugin"
require "i18n-js"
module Guard
class I18njs < Plugin
attr_reader :config_file, :require_file, :current_thread
def initialize(options = {})
@config_file = options.delete(:config_file)
@require_file = opti... | ruby | MIT | f8fb0dc0b01e7e639a6eb5dd875adbaa78858d8f | 2026-01-04T15:48:46.154368Z | false |
fnando/i18n-js | https://github.com/fnando/i18n-js/blob/f8fb0dc0b01e7e639a6eb5dd875adbaa78858d8f/lib/guard/i18n-js/version.rb | lib/guard/i18n-js/version.rb | # frozen_string_literal: true
gem "guard"
gem "guard-compat"
require "guard/compat/plugin"
require "i18n-js"
module Guard
class I18njsVersion < Plugin
VERSION = I18nJS::VERSION
end
end
| ruby | MIT | f8fb0dc0b01e7e639a6eb5dd875adbaa78858d8f | 2026-01-04T15:48:46.154368Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/yard/default/layout/html/setup.rb | yard/default/layout/html/setup.rb | # 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... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit_spec.rb | spec/octokit_spec.rb | # 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,... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/spec_helper.rb | spec/spec_helper.rb | # 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... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client_spec.rb | spec/octokit/client_spec.rb | # 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
#
... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | true |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/rate_limit_spec.rb | spec/octokit/rate_limit_spec.rb | # 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... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/repository_spec.rb | spec/octokit/repository_spec.rb | # 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... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/gist_spec.rb | spec/octokit/gist_spec.rb | # 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('... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/ghes_manage_spec.rb | spec/octokit/ghes_manage_spec.rb | # 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
| ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/enterprise_management_console_spec.rb | spec/octokit/enterprise_management_console_spec.rb | # frozen_string_literal: true
describe Octokit::EnterpriseManagementConsoleClient do
describe 'module configuration' do
it 'inherits Octokit::Client' do
admin_client = Octokit::EnterpriseManagementConsoleClient.new
expect admin_client.is_a? Octokit::Client
end
end
end
| ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/enterprise_admin_client_spec.rb | spec/octokit/enterprise_admin_client_spec.rb | # 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.... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/error_spec.rb | spec/octokit/error_spec.rb | # 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... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/organization_spec.rb | spec/octokit/organization_spec.rb | # 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... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/user_spec.rb | spec/octokit/user_spec.rb | # 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 ... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/enterprise_admin_client/search_indexing_spec.rb | spec/octokit/enterprise_admin_client/search_indexing_spec.rb | # frozen_string_literal: true
describe Octokit::EnterpriseAdminClient::SearchIndexing do
before do
Octokit.reset!
@admin_client = enterprise_admin_client
end
shared_examples 'search index queuer' do |expected_target|
context 'with a valid target' do
it "queues #{expected_target} to be indexed"... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/enterprise_admin_client/admin_stats_spec.rb | spec/octokit/enterprise_admin_client/admin_stats_spec.rb | # frozen_string_literal: true
describe Octokit::EnterpriseAdminClient::AdminStats do
before do
Octokit.reset!
@admin_client = enterprise_admin_client
end
describe '.admin_stats', :vcr do
it 'returns all available enterprise stats' do
admin_stats = @admin_client.admin_stats
expect(admin_... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/enterprise_admin_client/orgs_spec.rb | spec/octokit/enterprise_admin_client/orgs_spec.rb | # frozen_string_literal: true
describe Octokit::EnterpriseAdminClient::Orgs do
before do
Octokit.reset!
@admin_client = enterprise_admin_client
end
describe '.create_organization', :vcr do
it 'creates a new organization' do
@admin_client.create_organization('SuchAGreatOrg', 'gjtorikian')
... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/enterprise_admin_client/license_spec.rb | spec/octokit/enterprise_admin_client/license_spec.rb | # frozen_string_literal: true
describe Octokit::EnterpriseAdminClient::License do
before do
Octokit.reset!
@admin_client = enterprise_admin_client
end
describe '.license_info', :vcr do
it 'returns information about the license' do
license = @admin_client.license_info
expect(license.seat... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/enterprise_admin_client/users_spec.rb | spec/octokit/enterprise_admin_client/users_spec.rb | # frozen_string_literal: true
describe Octokit::EnterpriseAdminClient::Users do
before do
Octokit.reset!
@admin_client = enterprise_admin_client
end
describe '.create_user', :vcr do
it 'creates a new user' do
@admin_client.create_user('foobar', 'notreal@foo.bar')
expect(@admin_client.las... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/ghes_manage_client/ghes_manage_spec.rb | spec/octokit/ghes_manage_client/ghes_manage_spec.rb | # 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
... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/environments_spec.rb | spec/octokit/client/environments_spec.rb | # frozen_string_literal: true
describe Octokit::Client::Environments do
before do
Octokit.reset!
@client = oauth_client
@environment_name = 'octokit-environment'
end
after do
Octokit.reset!
end
describe '.environment', :vcr do
before(:each) do
@client.create_or_update_environment(... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/service_status_spec.rb | spec/octokit/client/service_status_spec.rb | # frozen_string_literal: true
describe Octokit::Client::ServiceStatus do
before do
Octokit.reset!
end
describe '.github_status_summary', :vcr do
it 'returns the current system status summary' do
current_status = Octokit.github_status_summary
expect(current_status.status).not_to be_nil
... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/repositories_spec.rb | spec/octokit/client/repositories_spec.rb | # frozen_string_literal: true
require 'faraday-http-cache'
require 'timecop'
describe Octokit::Client::Repositories do
before do
Octokit.reset!
@client = oauth_client
end
describe '.repository', :vcr do
it 'returns the matching repository' do
repository = @client.repository('sferik/rails_admi... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/hooks_spec.rb | spec/octokit/client/hooks_spec.rb | # frozen_string_literal: true
describe Octokit::Client::Hooks do
before do
Octokit.reset!
@client = oauth_client
end
context 'with repository' do
before(:each) do
@repo = @client.create_repository('an-repo')
end
after(:each) do
@client.delete_repository(@repo.full_name)
resc... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/reviews_spec.rb | spec/octokit/client/reviews_spec.rb | # 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_... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/commit_comments_spec.rb | spec/octokit/client/commit_comments_spec.rb | # 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... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/search_spec.rb | spec/octokit/client/search_spec.rb | # frozen_string_literal: true
describe Octokit::Client::Search do
before do
Octokit.reset!
@client = oauth_client
end
describe '.search_code' do
it 'searches code', :vcr do
results = @client.search_code 'code user:github in:file extension:gemspec -repo:octokit/octokit.rb',
... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/stats_spec.rb | spec/octokit/client/stats_spec.rb | # frozen_string_literal: true
describe Octokit::Client::Stats do
before do
Octokit.reset!
@client = oauth_client
end
context 'with empty repo' do
before do
VCR.turn_off!
stub_request(:any, %r{api\.github\.com/repos/octokit})
.to_return(
{ status: 202 }, # Cold request
... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/actions_workflow_runs_spec.rb | spec/octokit/client/actions_workflow_runs_spec.rb | # frozen_string_literal: true
describe Octokit::Client::ActionsWorkflowRuns, :vcr do
before do
Octokit.reset!
@client = oauth_client
@run_id = 96_922_843
end
after do
Octokit.reset!
end
describe '.workflow_runs' do
workflow_name = 'workflow.yml'
it 'returns runs for a workflow' do
... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/apps_spec.rb | spec/octokit/client/apps_spec.rb | # frozen_string_literal: true
describe Octokit::Client::Apps do
before(:each) do
Octokit.reset!
@client = oauth_client
@jwt_client = Octokit::Client.new(bearer_token: new_jwt_token)
use_vcr_placeholder_for(@jwt_client.bearer_token, '<JWT_BEARER_TOKEN>')
end
after(:each) do
Octokit.reset!... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/pull_requests_spec.rb | spec/octokit/client/pull_requests_spec.rb | # frozen_string_literal: true
describe Octokit::Client::PullRequests do
before do
Octokit.reset!
@client = oauth_client
end
describe '.pull_requests', :vcr do
it 'lists all pull requests' do
pulls = @client.pulls('octokit/octokit.rb')
expect(pulls).to be_kind_of Array
assert_reques... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/downloads_spec.rb | spec/octokit/client/downloads_spec.rb | # 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 ... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/actions_secrets_spec.rb | spec/octokit/client/actions_secrets_spec.rb | # frozen_string_literal: true
require 'rbnacl'
require 'base64'
def create_box(public_key)
b64_key = RbNaCl::PublicKey.new(Base64.decode64(public_key[:key]))
{
key_id: public_key[:key_id],
box: RbNaCl::Boxes::Sealed.from_public_key(b64_key)
}
end
describe Octokit::Client::ActionsSecrets do
before do
... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/emojis_spec.rb | spec/octokit/client/emojis_spec.rb | # frozen_string_literal: true
describe Octokit::Client::Emojis do
describe '.emojis', :vcr do
it 'returns all github emojis' do
client = oauth_client
emojis = client.emojis
expect(emojis[:metal]).to match(/metal/)
end
end # .emojis
end
| ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/feeds_spec.rb | spec/octokit/client/feeds_spec.rb | # frozen_string_literal: true
describe Octokit::Client::Feeds do
before do
Octokit.reset!
end
describe '.feeds', :vcr do
context 'when unauthenticated' do
it 'returns the public feeds list' do
feeds = Octokit.feeds
expect(Octokit.user_authenticated?).to be false
expect(feed... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/oauth_applications_spec.rb | spec/octokit/client/oauth_applications_spec.rb | # frozen_string_literal: true
require 'securerandom'
# Right now until we come up with a better way we have to make these tokens
# by hand because the Authorizations API is going away.
#
# See https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api/
describe Octokit::Client::OauthA... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/traffic_spec.rb | spec/octokit/client/traffic_spec.rb | # frozen_string_literal: true
describe Octokit::Client::Traffic do
describe '.top_referrers', :vcr do
it 'returns the referrers stats for a repository' do
referrers = oauth_client.top_referrers(@test_repo)
expect(referrers).to be_kind_of Array
assert_requested :get, github_url("/repos/#{@test_r... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/repository_invitations_spec.rb | spec/octokit/client/repository_invitations_spec.rb | # frozen_string_literal: true
describe Octokit::Client::RepositoryInvitations do
before do
Octokit.reset!
@client = oauth_client
end
context 'with repository' do
before(:each) do
@repo = @client.create_repository('an-repo', organization: test_github_org)
end
after(:each) do
@cli... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/issues_spec.rb | spec/octokit/client/issues_spec.rb | # frozen_string_literal: true
describe Octokit::Client::Issues do
before do
Octokit.reset!
@client = oauth_client
end
after do
Octokit.reset!
end
describe '.list_issues', :vcr do
it 'returns issues for a repository' do
issues = @client.issues('sferik/rails_admin')
expect(issues)... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/organizations_spec.rb | spec/octokit/client/organizations_spec.rb | # frozen_string_literal: true
describe Octokit::Client::Organizations do
before do
Octokit.reset!
@client = oauth_client
end
describe '.organization', :vcr do
it 'returns an organization' do
organization = @client.organization('codeforamerica')
expect(organization.name).to eq('Code for A... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/pages_spec.rb | spec/octokit/client/pages_spec.rb | # frozen_string_literal: true
describe Octokit::Client::Pages do
before do
Octokit.reset!
@client = oauth_client
end
describe '.pages', :vcr do
it 'lists page information' do
pages = @client.pages('github/developer.github.com')
expect(pages.cname).to eq('developer.github.com')
asse... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/gists_spec.rb | spec/octokit/client/gists_spec.rb | # frozen_string_literal: true
describe Octokit::Client::Gists do
before do
Octokit.reset!
end
describe 'unauthenticated', :vcr do
describe '.public_gists' do
it 'returns public gists' do
gists = Octokit.client.public_gists
expect(gists).not_to be_empty
assert_requested :get... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/community_profile_spec.rb | spec/octokit/client/community_profile_spec.rb | # frozen_string_literal: true
describe Octokit::Client::CommunityProfile do
before do
Octokit.reset!
@client = oauth_client
end
describe '.community_profile', :vcr do
it 'returns community profile metrics for a repository' do
community_profile = @client.community_profile('octokit/octokit.rb')
... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/rate_limit_spec.rb | spec/octokit/client/rate_limit_spec.rb | # frozen_string_literal: true
describe Octokit::Client do
subject { Octokit::Client }
let(:client) { Octokit::Client.new }
describe '#rate_limit' do
context 'with no last response' do
it 'makes a response', vcr: { cassette_name: 'rate_limit' } do
rate = client.rate_limit
expect(rate.l... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/releases_spec.rb | spec/octokit/client/releases_spec.rb | # frozen_string_literal: true
describe Octokit::Client::Releases do
before do
Octokit.reset!
@client = oauth_client
end
describe '.releases' do
it 'lists releases for a repo', :vcr do
releases = @client.releases @test_repo
expect(releases).to be_kind_of Array
assert_requested :get,... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/reactions_spec.rb | spec/octokit/client/reactions_spec.rb | # frozen_string_literal: true
describe Octokit::Client::Reactions do
before do
Octokit.reset!
@client = oauth_client
end
context 'with repository', :vcr do
before(:each) do
@repo = @client.create_repository('an-repo', auto_init: true)
end
after(:each) do
@client.delete_repositor... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/projects_spec.rb | spec/octokit/client/projects_spec.rb | # 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... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/tokens_spec.rb | spec/octokit/client/tokens_spec.rb | # frozen_string_literal: true
require 'securerandom'
describe Octokit::Client::Tokens do
before do
Octokit.reset!
@client = basic_auth_client
@app_client = Octokit::Client.new \
client_id: test_github_client_id,
client_secret: test_github_client_secret
end
after do
Octokit.reset!
... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/commit_pulls_spec.rb | spec/octokit/client/commit_pulls_spec.rb | # frozen_string_literal: true
describe Octokit::Client::CommitPulls do
before do
Octokit.reset!
@client = Octokit::Client.new
end
describe '.commit_pulls', :vcr do
it 'returns a list of all pull requests associated with a commit' do
pulls = @client.commit_pulls(
'sferik/rails_admin',
... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/contents_spec.rb | spec/octokit/client/contents_spec.rb | # 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')... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/objects_spec.rb | spec/octokit/client/objects_spec.rb | # frozen_string_literal: true
describe Octokit::Client::Objects do
before do
Octokit.reset!
@client = oauth_client
end
describe '.tree', :vcr do
it 'gets a tree' do
result = @client.tree('sferik/rails_admin', '3cdfabd973bc3caac209cba903cfdb3bf6636bcd')
expect(result.sha).to eq('3cdfabd97... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/users_spec.rb | spec/octokit/client/users_spec.rb | # frozen_string_literal: true
describe Octokit::Client::Users do
before(:each) do
Octokit.reset!
@client = oauth_client
end
describe '.all_users', :vcr do
it 'returns all GitHub users' do
users = Octokit.all_users
expect(users).to be_kind_of Array
end
end # .all_users
describe '... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/source_import_spec.rb | spec/octokit/client/source_import_spec.rb | # frozen_string_literal: true
describe Octokit::Client::SourceImport do
before do
Octokit.reset!
@client = oauth_client
end
before(:each) do
@repo = @client.create_repository('an-repo')
end
after(:each) do
@client.delete_repository(@repo.full_name)
rescue Octokit::NotFound
end
descri... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/refs_spec.rb | spec/octokit/client/refs_spec.rb | # frozen_string_literal: true
describe Octokit::Client::Refs do
before do
Octokit.reset!
@client = oauth_client
end
describe '.matching_refs', :vcr do
it 'returns all matching refs' do
refs = @client.matching_refs('sferik/rails_admin', 'heads/rails')
expect(refs).to be_kind_of Array
... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/deployments_spec.rb | spec/octokit/client/deployments_spec.rb | # frozen_string_literal: true
describe Octokit::Client::Deployments do
before do
Octokit.reset!
@client = oauth_client
end
after do
Octokit.reset!
end
describe '.deployments', :vcr do
it 'lists deployments' do
deployments = @client.deployments(@test_repo)
expect(deployments).to ... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/statuses_spec.rb | spec/octokit/client/statuses_spec.rb | # 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... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/milestones_spec.rb | spec/octokit/client/milestones_spec.rb | # frozen_string_literal: true
describe Octokit::Client::Milestones do
before do
Octokit.reset!
@client = oauth_client
end
describe '.list_milestones', :vcr do
it 'lists milestones belonging to repository' do
milestones = @client.list_milestones(@test_repo)
expect(milestones).to be_kind_o... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/labels_spec.rb | spec/octokit/client/labels_spec.rb | # frozen_string_literal: true
describe Octokit::Client::Labels do
before do
Octokit.reset!
@client = oauth_client
end
describe '.labels', :vcr do
it 'returns labels' do
labels = @client.labels('octokit/octokit.rb')
expect(labels).to be_kind_of Array
assert_requested :get, github_ur... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/say_spec.rb | spec/octokit/client/say_spec.rb | # frozen_string_literal: true
describe Octokit::Client::Say do
before do
Octokit.reset!
@client = oauth_client
end
describe '.say', :vcr do
it 'returns an ASCII octocat' do
text = @client.say
expect(text).to match(/MMMMMMMMMMMMMMMMMMMMM/)
assert_requested :get, github_url('/octocat... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/dependabot_secrets_spec.rb | spec/octokit/client/dependabot_secrets_spec.rb | # frozen_string_literal: true
require 'rbnacl'
require 'base64'
def create_box(public_key)
b64_key = RbNaCl::PublicKey.new(Base64.decode64(public_key[:key]))
{
key_id: public_key[:key_id],
box: RbNaCl::Boxes::Sealed.from_public_key(b64_key)
}
end
describe Octokit::Client::DependabotSecrets do
before ... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/commits_spec.rb | spec/octokit/client/commits_spec.rb | # frozen_string_literal: true
describe Octokit::Client::Commits do
before do
Octokit.reset!
@client = oauth_client
end
describe '.commits', :vcr do
it 'returns all commits' do
commits = @client.commits('sferik/rails_admin')
expect(commits.first.author).not_to be_nil
assert_requeste... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/legacy_search_spec.rb | spec/octokit/client/legacy_search_spec.rb | # frozen_string_literal: true
describe Octokit::Client::LegacySearch do
before do
Octokit.reset!
@client = oauth_client
end
describe '.legacy_search_issues', :vcr do
it 'returns matching issues' do
issues = @client.legacy_search_issues('sferik/rails_admin', 'activerecord')
expect(issues)... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/codespaces_secrets_spec.rb | spec/octokit/client/codespaces_secrets_spec.rb | # frozen_string_literal: true
require 'rbnacl'
require 'base64'
def create_box(public_key)
b64_key = RbNaCl::PublicKey.new(Base64.decode64(public_key[:key]))
{
key_id: public_key[:key_id],
box: RbNaCl::Boxes::Sealed.from_public_key(b64_key)
}
end
describe Octokit::Client::CodespacesSecrets do
before ... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/notifications_spec.rb | spec/octokit/client/notifications_spec.rb | # frozen_string_literal: true
describe Octokit::Client::Notifications do
before do
Octokit.reset!
@client = oauth_client
end
describe '.notifications', :vcr do
it 'lists the notifications for the current user' do
notifications = @client.notifications
expect(notifications).to be_kind_of A... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/actions_workflows_spec.rb | spec/octokit/client/actions_workflows_spec.rb | # frozen_string_literal: true
describe Octokit::Client::ActionsWorkflows do
before do
Octokit.reset!
@client = oauth_client
end
describe '.workflows', :vcr do
it 'returns the repository workflows' do
@client.workflows(@test_repo)
assert_requested :get, github_url("/repos/#{@test_repo}/a... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/actions_artifacts_spec.rb | spec/octokit/client/actions_artifacts_spec.rb | # 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... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/code_scanning_spec.rb | spec/octokit/client/code_scanning_spec.rb | # frozen_string_literal: true
describe Octokit::Client::CodeScanning do
before do
@client = oauth_client
@sarif_id = 'fb31fa2c-095d-11ee-98fe-c609abca1772'
@code_scanning_test_repo = 'Caja-de-Dano/active-wrapper'
end
describe '.list_code_scanning_alerts_for_org', :vcr do
it 'lists code scanning ... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/events_spec.rb | spec/octokit/client/events_spec.rb | # frozen_string_literal: true
describe Octokit::Client::Events do
before do
Octokit.reset!
@client = oauth_client
end
describe '.public_events', :vcr do
it 'returns all public events' do
public_events = @client.public_events
expect(public_events).to be_kind_of Array
assert_requeste... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/licenses_spec.rb | spec/octokit/client/licenses_spec.rb | # frozen_string_literal: true
require 'base64'
describe Octokit::Client::Licenses do
describe '.licenses', :vcr do
it 'returns all licenses' do
licenses = Octokit.licenses
expect(licenses).to be_kind_of Array
end
end
describe '.license', :vcr do
it 'returns a particular license' do
... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/gitignore_spec.rb | spec/octokit/client/gitignore_spec.rb | # 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... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/meta_spec.rb | spec/octokit/client/meta_spec.rb | # frozen_string_literal: true
describe Octokit::Client::Meta do
describe '.github_meta', :vcr do
it 'returns meta information about github' do
github_meta = oauth_client.github_meta
expect(github_meta.git).to be
assert_requested :get, github_url('/meta')
end
end # .github_meta
end
| ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/commit_branches_spec.rb | spec/octokit/client/commit_branches_spec.rb | # frozen_string_literal: true
describe Octokit::Client::CommitBranches do
before do
Octokit.reset!
@client = Octokit::Client.new
end
describe '.commit_branches', :vcr do
it 'returns a list of all branches associated with a commit' do
branches = @client.commit_branches(
'sferik/rails_ad... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/marketplace_spec.rb | spec/octokit/client/marketplace_spec.rb | # frozen_string_literal: true
describe Octokit::Client::Marketplace do
before(:each) do
Octokit.reset!
@client = oauth_client
@jwt_client = Octokit::Client.new(bearer_token: new_jwt_token)
use_vcr_placeholder_for(@jwt_client.bearer_token, '<JWT_BEARER_TOKEN>')
end
after(:each) do
Octokit... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/markdown_spec.rb | spec/octokit/client/markdown_spec.rb | # frozen_string_literal: true
describe Octokit::Client::Markdown do
before do
Octokit.reset!
@client = oauth_client
end
describe '.markdown', :vcr do
it 'renders markdown' do
text = 'This is for #111'
markdown = @client.markdown(text, context: 'octokit/octokit.rb', mode: 'gfm')
ex... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/checks_spec.rb | spec/octokit/client/checks_spec.rb | # frozen_string_literal: true
describe Octokit::Client::Checks, :vcr do
before do
Octokit.reset!
@client = oauth_client
@path = 'README.md'
@commit = 'e1db7418a77db065d1900e579c82ef0aad1da2b1'
@branch = 'master' # Equivalent to @commit
@tag = 'v1.0' # Equivalent to @commit
@check_suite_i... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/client/actions_workflow_jobs_spec.rb | spec/octokit/client/actions_workflow_jobs_spec.rb | # frozen_string_literal: true
describe Octokit::Client::ActionsWorkflowJobs, :vcr do
before do
Octokit.reset!
@client = oauth_client
@run_id = 3_163_227_438
@attempt_number = 1
@job_id = 69_548_127
end
after do
Octokit.reset!
end
describe '.workflow_run_job' do
it 'returns job f... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/spec/octokit/enterprise_management_console_client/management_console_spec.rb | spec/octokit/enterprise_management_console_client/management_console_spec.rb | # frozen_string_literal: true
describe Octokit::EnterpriseManagementConsoleClient::ManagementConsole do
before do
Octokit.reset!
@enterprise_management_console_client = enterprise_management_console_client
@license = 'spec/fixtures/github-enterprise.ghl'
@api_key = test_github_enterprise_management_c... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/lib/octokit.rb | lib/octokit.rb | # frozen_string_literal: true
require 'octokit/default'
require 'octokit/client'
require 'octokit/enterprise_admin_client'
require 'octokit/enterprise_management_console_client'
require 'octokit/manage_ghes_client'
# Ruby toolkit for the GitHub API
module Octokit
class << self
include Octokit::Configurable
... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/lib/octokit/authentication.rb | lib/octokit/authentication.rb | # frozen_string_literal: true
module Octokit
# Authentication methods for {Octokit::Client}
module Authentication
# In Faraday 2.x, the authorization middleware uses new interface
FARADAY_BASIC_AUTH_KEYS =
if Gem::Version.new(Faraday::VERSION) >= Gem::Version.new('2.0')
%i[authorization basic... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/lib/octokit/repository.rb | lib/octokit/repository.rb | # 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 ... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/lib/octokit/version.rb | lib/octokit/version.rb | # frozen_string_literal: true
module Octokit
# Current major release.
# @return [Integer]
MAJOR = 10
# Current minor release.
# @return [Integer]
MINOR = 0
# Current patch level.
# @return [Integer]
PATCH = 0
# Full release version.
# @return [String]
VERSION = [MAJOR, MINOR, PATCH].join('.'... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/lib/octokit/default.rb | lib/octokit/default.rb | # 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... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/lib/octokit/gist.rb | lib/octokit/gist.rb | # 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
... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/lib/octokit/arguments.rb | lib/octokit/arguments.rb | # 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
| ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/lib/octokit/rate_limit.rb | lib/octokit/rate_limit.rb | # 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... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/lib/octokit/warnable.rb | lib/octokit/warnable.rb | # 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... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/lib/octokit/connection.rb | lib/octokit/connection.rb | # frozen_string_literal: true
require 'sawyer'
require 'octokit/authentication'
module Octokit
# Network layer for API clients.
module Connection
include Octokit::Authentication
# Header keys that can be passed in options hash to {#get},{#head}
CONVENIENCE_HEADERS = Set.new(%i[accept content_type])
... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/lib/octokit/organization.rb | lib/octokit/organization.rb | # frozen_string_literal: true
module Octokit
# GitHub organization class to generate API path urls
class Organization
# Get the api path for an organization
#
# @param org [String, Integer] GitHub organization login or id
# @return [String] Organization Api path
def self.path(org)
case or... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
octokit/octokit.rb | https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/lib/octokit/client.rb | lib/octokit/client.rb | # 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... | ruby | MIT | ea3413c3174571e87c83d358fc893cc7613091fa | 2026-01-04T15:47:59.787784Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.