code
stringlengths 26
124k
| docstring
stringlengths 23
125k
| func_name
stringlengths 1
98
| language
stringclasses 1
value | repo
stringlengths 5
53
| path
stringlengths 7
151
| url
stringlengths 50
211
| license
stringclasses 7
values |
---|---|---|---|---|---|---|---|
def refs(repo, namespace = nil, options = {})
path = "#{Repository.path repo}/git/refs"
path += "/#{namespace}" unless namespace.nil?
paginate path, options
end
|
List all refs for a given user and repo
@param repo [Integer, String, Repository, Hash] A GitHub repository
@param namespace [String] The ref namespace, e.g. <tt>tag</tt> or <tt>heads</tt>
@return [Array<Sawyer::Resource>] A list of references matching the repo and the namespace
@see https://developer.github.com/v3/git/refs/#get-all-references
@example Fetch all refs for sferik/rails_admin
Octokit.refs("sferik/rails_admin")
|
refs
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/refs.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/refs.rb
|
Apache-2.0
|
def matching_refs(repo, ref, options = {})
paginate "#{Repository.path repo}/git/matching-refs/#{ref}", options
end
|
Fetch matching refs
@param repo [Integer, String, Repository, Hash] A GitHub repository
@param ref [String] The ref, e.g. <tt>tags/v0.0.3</tt> or <tt>heads/rails-3</tt>
@return [Array<Sawyer::Resource>] The reference matching the given repo and the ref id
@see https://developer.github.com/v3/git/refs/#list-matching-references
@example Fetch refs matching tags/v2 for sferik/rails_admin
Octokit.ref("sferik/rails_admin","tags/v2")
|
matching_refs
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/refs.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/refs.rb
|
Apache-2.0
|
def ref(repo, ref, options = {})
get "#{Repository.path repo}/git/refs/#{ref}", options
end
|
Fetch a given reference
@param repo [Integer, String, Repository, Hash] A GitHub repository
@param ref [String] The ref, e.g. <tt>tags/v0.0.3</tt>
@return [Sawyer::Resource] The reference matching the given repo and the ref id
@see https://developer.github.com/v3/git/refs/#get-a-reference
@example Fetch tags/v0.0.3 for sferik/rails_admin
Octokit.ref("sferik/rails_admin","tags/v0.0.3")
|
ref
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/refs.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/refs.rb
|
Apache-2.0
|
def create_ref(repo, ref, sha, options = {})
ref = "refs/#{ref}" unless ref =~ %r{\Arefs/}
parameters = {
ref: ref,
sha: sha
}
post "#{Repository.path repo}/git/refs", options.merge(parameters)
end
|
Create a reference
@param repo [Integer, String, Repository, Hash] A GitHub repository
@param ref [String] The ref, e.g. <tt>tags/v0.0.3</tt>
@param sha [String] A SHA, e.g. <tt>827efc6d56897b048c772eb4087f854f46256132</tt>
@return [Array<Sawyer::Resource>] The list of references, already containing the new one
@see https://developer.github.com/v3/git/refs/#create-a-reference
@example Create refs/heads/master for octocat/Hello-World with sha 827efc6d56897b048c772eb4087f854f46256132
Octokit.create_ref("octocat/Hello-World", "heads/master", "827efc6d56897b048c772eb4087f854f46256132")
|
create_ref
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/refs.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/refs.rb
|
Apache-2.0
|
def update_ref(repo, ref, sha, force = true, options = {})
parameters = {
sha: sha,
force: force
}
patch "#{Repository.path repo}/git/refs/#{ref}", options.merge(parameters)
end
|
Update a reference
@param repo [Integer, String, Repository, Hash] A GitHub repository
@param ref [String] The ref, e.g. <tt>tags/v0.0.3</tt>
@param sha [String] A SHA, e.g. <tt>827efc6d56897b048c772eb4087f854f46256132</tt>
@param force [Boolean] A flag indicating whether to force the update or to make sure the update is a fast-forward update.
@return [Array<Sawyer::Resource>] The list of references updated
@see https://developer.github.com/v3/git/refs/#update-a-reference
@example Force update heads/sc/featureA for octocat/Hello-World with sha aa218f56b14c9653891f9e74264a383fa43fefbd
Octokit.update_ref("octocat/Hello-World", "heads/sc/featureA", "aa218f56b14c9653891f9e74264a383fa43fefbd")
@example Fast-forward update heads/sc/featureA for octocat/Hello-World with sha aa218f56b14c9653891f9e74264a383fa43fefbd
Octokit.update_ref("octocat/Hello-World", "heads/sc/featureA", "aa218f56b14c9653891f9e74264a383fa43fefbd", false)
|
update_ref
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/refs.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/refs.rb
|
Apache-2.0
|
def update_branch(repo, branch, sha, force = true, options = {})
update_ref repo, "heads/#{branch}", sha, force, options
end
|
Update a branch
@param repo [Integer, String, Repository, Hash] A GitHub repository
@param branch [String] The ref, e.g. <tt>feature/new-shiny</tt>
@param sha [String] A SHA, e.g. <tt>827efc6d56897b048c772eb4087f854f46256132</tt>
@param force [Boolean] A flag indicating whether to force the update or to make sure the update is a fast-forward update.
@return [Array<Sawyer::Resource>] The list of references updated
@see https://developer.github.com/v3/git/refs/#update-a-reference
@example Force update heads/sc/featureA for octocat/Hello-World with sha aa218f56b14c9653891f9e74264a383fa43fefbd
Octokit.update_branch("octocat/Hello-World", "sc/featureA", "aa218f56b14c9653891f9e74264a383fa43fefbd")
@example Fast-forward update heads/sc/featureA for octocat/Hello-World with sha aa218f56b14c9653891f9e74264a383fa43fefbd
Octokit.update_branch("octocat/Hello-World", "sc/featureA", "aa218f56b14c9653891f9e74264a383fa43fefbd", false)
|
update_branch
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/refs.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/refs.rb
|
Apache-2.0
|
def delete_branch(repo, branch, options = {})
delete_ref repo, "heads/#{branch}", options
end
|
Delete a single branch
@param repo [Integer, String, Repository, Hash] A GitHub repository
@param branch [String] The branch, e.g. <tt>fix-refs</tt>
@return [Boolean] Success
@see https://developer.github.com/v3/git/refs/#delete-a-reference
@example Delete uritemplate for sigmavirus24/github3.py
Octokit.delete_branch("sigmavirus24/github3.py", "uritemplate")
|
delete_branch
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/refs.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/refs.rb
|
Apache-2.0
|
def delete_ref(repo, ref, options = {})
boolean_from_response :delete, "#{Repository.path repo}/git/refs/#{ref}", options
end
|
Delete a single reference
@param repo [Integer, String, Repository, Hash] A GitHub repository
@param ref [String] The ref, e.g. <tt>tags/v0.0.3</tt>
@return [Boolean] Success
@see https://developer.github.com/v3/git/refs/#delete-a-reference
@example Delete tags/v0.0.3 for sferik/rails_admin
Octokit.delete_ref("sferik/rails_admin","tags/v0.0.3")
|
delete_ref
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/refs.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/refs.rb
|
Apache-2.0
|
def releases(repo, options = {})
paginate "#{Repository.path repo}/releases", options
end
|
List releases for a repository
@param repo [Integer, String, Repository, Hash] A GitHub repository
@return [Array<Sawyer::Resource>] A list of releases
@see https://developer.github.com/v3/repos/releases/#list-releases-for-a-repository
|
releases
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/releases.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/releases.rb
|
Apache-2.0
|
def release(url, options = {})
get url, options
end
|
Get a release
@param url [String] URL for the release as returned from .releases
@return [Sawyer::Resource] The release
@see https://developer.github.com/v3/repos/releases/#get-a-single-release
|
release
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/releases.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/releases.rb
|
Apache-2.0
|
def delete_release(url, options = {})
boolean_from_response(:delete, url, options)
end
|
Delete a release
@param url [String] URL for the release as returned from .releases
@return [Boolean] Success or failure
@see https://developer.github.com/v3/repos/releases/#delete-a-release
|
delete_release
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/releases.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/releases.rb
|
Apache-2.0
|
def release_assets(release_url, options = {})
paginate release(release_url).rels[:assets].href, options
end
|
List release assets
@param release_url [String] URL for the release as returned from .releases
@return [Array<Sawyer::Resource>] A list of release assets
@see https://developer.github.com/v3/repos/releases/#list-assets-for-a-release
|
release_assets
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/releases.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/releases.rb
|
Apache-2.0
|
def upload_asset(release_url, path_or_file, options = {})
file = path_or_file.respond_to?(:read) ? path_or_file : File.new(path_or_file, 'rb')
options[:content_type] ||= content_type_from_file(file)
raise Octokit::MissingContentType if options[:content_type].nil?
unless name = options[:name]
name = File.basename(file.path)
end
upload_url = release(release_url).rels[:upload].href_template.expand(name: name)
request :post, upload_url, file.read, parse_query_and_convenience_headers(options)
ensure
file&.close
end
|
Upload a release asset
@param release_url [String] URL for the release as returned from .releases
@param path_or_file [String] Path to file to upload
@option options [String] :content_type The MIME type for the file to upload
@option options [String] :name The name for the file
@return [Sawyer::Resource] The release asset
@see https://developer.github.com/v3/repos/releases/#upload-a-release-asset
|
upload_asset
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/releases.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/releases.rb
|
Apache-2.0
|
def release_asset(asset_url, options = {})
get(asset_url, options)
end
|
Get a single release asset
@param asset_url [String] URL for the asset as returned from .release_assets
@return [Sawyer::Resource] The release asset
@see https://developer.github.com/v3/repos/releases/#get-a-single-release-asset
|
release_asset
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/releases.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/releases.rb
|
Apache-2.0
|
def update_release_asset(asset_url, options = {})
patch(asset_url, options)
end
|
Update a release asset
@param asset_url [String] URL for the asset as returned from .release_assets
@option options [String] :name The name for the file
@option options [String] :label The download text for the file
@return [Sawyer::Resource] The release asset
@see https://developer.github.com/v3/repos/releases/#edit-a-release-asset
|
update_release_asset
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/releases.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/releases.rb
|
Apache-2.0
|
def delete_release_asset(asset_url, options = {})
boolean_from_response(:delete, asset_url, options)
end
|
Delete a release asset
@param asset_url [String] URL for the asset as returned from .release_assets
@return [Boolean] Success or failure
@see https://developer.github.com/v3/repos/releases/#delete-a-release-asset
|
delete_release_asset
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/releases.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/releases.rb
|
Apache-2.0
|
def release_for_tag(repo, tag_name, options = {})
get "#{Repository.path repo}/releases/tags/#{tag_name}", options
end
|
Get the release for a given tag
@param repo [Integer, String, Repository, Hash] A GitHub repository
@param tag_name [String] the name for a tag
@return [Sawyer::Resource] The release
@see https://developer.github.com/v3/repos/releases/#get-a-release-by-tag-name
|
release_for_tag
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/releases.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/releases.rb
|
Apache-2.0
|
def latest_release(repo, options = {})
get "#{Repository.path repo}/releases/latest", options
end
|
Get the latest release
@param repo [Integer, String, Repository, Hash] A GitHub repository
@return [Sawyer::Resource] The release
@see https://developer.github.com/v3/repos/releases/#get-the-latest-release
|
latest_release
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/releases.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/releases.rb
|
Apache-2.0
|
def repository?(repo, options = {})
!!repository(repo, options)
rescue Octokit::InvalidRepository
false
rescue Octokit::NotFound
false
end
|
Check if a repository exists
@see https://developer.github.com/v3/repos/#get
@param repo [Integer, String, Hash, Repository] A GitHub repository
@return [Boolean]
|
repository?
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/repositories.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/repositories.rb
|
Apache-2.0
|
def edit_repository(repo, options = {})
repo = Repository.new(repo)
if options.include? :is_template
options = ensure_api_media_type(:template_repositories, options)
end
options[:name] ||= repo.name
patch "repos/#{repo}", options
end
|
Edit a repository
@see https://developer.github.com/v3/repos/#update-a-repository
@param repo [String, Hash, Repository] A GitHub repository
@param options [Hash] Repository information to update
@option options [String] :name Name of the repo
@option options [String] :description Description of the repo
@option options [String] :homepage Home page of the repo
@option options [String] :private `true` makes the repository private, and `false` makes it public.
@option options [String] :has_issues `true` enables issues for this repo, `false` disables issues.
@option options [String] :has_wiki `true` enables wiki for this repo, `false` disables wiki.
@option options [Boolean] :is_template `true` makes the repository a template, `false` makes it not a template.
@option options [String] :has_downloads `true` enables downloads for this repo, `false` disables downloads.
@option options [String] :default_branch Update the default branch for this repository.
@return [Sawyer::Resource] Repository information
|
edit_repository
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/repositories.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/repositories.rb
|
Apache-2.0
|
def repositories(user = nil, options = {})
paginate "#{User.path user}/repos", options
end
|
List user repositories
If user is not supplied, repositories for the current
authenticated user are returned.
@note If the user provided is a GitHub organization, only the
organization's public repositories will be listed. For retrieving
organization repositories the {Organizations#organization_repositories}
method should be used instead.
@see https://developer.github.com/v3/repos/#list-your-repositories
@see https://developer.github.com/v3/repos/#list-user-repositories
@param user [Integer, String] Optional GitHub user login or id for which
to list repos.
@return [Array<Sawyer::Resource>] List of repositories
|
repositories
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/repositories.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/repositories.rb
|
Apache-2.0
|
def invite_user_to_repository(repo, user, options = {})
put "#{Repository.path repo}/collaborators/#{user}", options
end
|
Invite a user to a repository
Requires authenticated client
@param repo [Integer, String, Hash, Repository] A GitHub repository
@param user [String] User GitHub username to add
@return [Sawyer::Resource] The repository invitation
@see https://developer.github.com/v3/repos/collaborators/#add-user-as-a-collaborator
|
invite_user_to_repository
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/repository_invitations.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/repository_invitations.rb
|
Apache-2.0
|
def repository_invitations(repo, options = {})
paginate "#{Repository.path repo}/invitations", options
end
|
List all invitations for a repository
Requires authenticated client
@param repo [Integer, String, Repository, Hash] A GitHub repository
@return [Array<Sawyer::Resource>] A list of invitations
@see https://developer.github.com/v3/repos/invitations/#list-invitations-for-a-repository
|
repository_invitations
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/repository_invitations.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/repository_invitations.rb
|
Apache-2.0
|
def delete_repository_invitation(repo, invitation_id, options = {})
boolean_from_response :delete, "#{Repository.path repo}/invitations/#{invitation_id}", options
end
|
Delete an invitation for a repository
Requires authenticated client
@param repo [Integer, String, Repository, Hash] A GitHub repository
@param invitation_id [Integer] The id of the invitation
@return [Boolean] True if the invitation was successfully deleted
@see https://developer.github.com/v3/repos/invitations/#delete-a-repository-invitation
|
delete_repository_invitation
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/repository_invitations.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/repository_invitations.rb
|
Apache-2.0
|
def update_repository_invitation(repo, invitation_id, options = {})
patch "#{Repository.path repo}/invitations/#{invitation_id}", options
end
|
Update an invitation for a repository
Requires authenticated client
@param repo [Integer, String, Repository, Hash] A GitHub repository
@param invitation_id [Integer] The id of the invitation
@return [Sawyer::Resource] The updated repository invitation
@see https://developer.github.com/v3/repos/invitations/#update-a-repository-invitation
|
update_repository_invitation
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/repository_invitations.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/repository_invitations.rb
|
Apache-2.0
|
def user_repository_invitations(options = {})
paginate '/user/repository_invitations', options
end
|
List all repository invitations for the user
Requires authenticated client
@return [Array<Sawyer::Resource>] The users repository invitations
@see https://developer.github.com/v3/repos/invitations/#list-a-users-repository-invitations
|
user_repository_invitations
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/repository_invitations.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/repository_invitations.rb
|
Apache-2.0
|
def accept_repository_invitation(invitation_id, options = {})
patch "/user/repository_invitations/#{invitation_id}", options
end
|
Accept a repository invitation
Requires authenticated client
@param invitation_id [Integer] The id of the invitation
@return [Boolean] True if the acceptance of the invitation was successful
@see https://developer.github.com/v3/repos/invitations/#accept-a-repository-invitation
|
accept_repository_invitation
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/repository_invitations.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/repository_invitations.rb
|
Apache-2.0
|
def decline_repository_invitation(invitation_id, options = {})
boolean_from_response :delete, "/user/repository_invitations/#{invitation_id}", options
end
|
Decline a repository invitation
Requires authenticated client
@param invitation_id [Integer] The id of the invitation
@return [Boolean] True if the acceptance of the invitation was successful
@see https://developer.github.com/v3/repos/invitations/#decline-a-repository-invitation
|
decline_repository_invitation
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/repository_invitations.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/repository_invitations.rb
|
Apache-2.0
|
def pull_request_reviews(repo, number, options = {})
paginate "#{Repository.path repo}/pulls/#{number}/reviews", options
end
|
List reviews on a pull request
@param repo [Integer, String, Hash, Repository] A GitHub repository
@param number [Integer] Number ID of the pull request
@see https://developer.github.com/v3/pulls/reviews/#list-reviews-on-a-pull-request
@example
@client.pull_request_reviews('octokit/octokit.rb', 2)
@return [Array<Sawyer::Resource>] Array of Hashes representing the reviews
|
pull_request_reviews
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/reviews.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/reviews.rb
|
Apache-2.0
|
def pull_request_review(repo, number, review, options = {})
get "#{Repository.path repo}/pulls/#{number}/reviews/#{review}", options
end
|
Get a single review
@param repo [Integer, String, Hash, Repository] A GitHub repository
@param number [Integer] Number ID of the pull request
@param review [Integer] The id of the review
@see https://developer.github.com/v3/pulls/reviews/#get-a-single-review
@example
@client.pull_request_review('octokit/octokit.rb', 825, 6505518)
@return [Sawyer::Resource] Hash representing the review
|
pull_request_review
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/reviews.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/reviews.rb
|
Apache-2.0
|
def delete_pull_request_review(repo, number, review, options = {})
delete "#{Repository.path repo}/pulls/#{number}/reviews/#{review}", options
end
|
Delete a pending review
@param repo [Integer, String, Hash, Repository] A GitHub repository
@param number [Integer] Number ID of the pull request
@param review [Integer] The id of the review
@see https://developer.github.com/v3/pulls/reviews/#delete-a-pending-review
@example
@client.delete_pull_request_review('octokit/octokit.rb', 825, 6505518)
@return [Sawyer::Resource] Hash representing the deleted review
|
delete_pull_request_review
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/reviews.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/reviews.rb
|
Apache-2.0
|
def pull_request_review_comments(repo, number, review, options = {})
paginate "#{Repository.path repo}/pulls/#{number}/reviews/#{review}/comments", options
end
|
Get comments for a single review
@param repo [Integer, String, Hash, Repository] A GitHub repository
@param number [Integer] Number ID of the pull request
@param review [Integer] The id of the review
@see https://developer.github.com/v3/pulls/reviews/#get-comments-for-a-single-review
@example
@client.pull_request_review_comments('octokit/octokit.rb', 825, 6505518)
@return [Array<Sawyer::Resource>] Array of Hashes representing the review comments
|
pull_request_review_comments
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/reviews.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/reviews.rb
|
Apache-2.0
|
def create_pull_request_review(repo, number, options = {})
post "#{Repository.path repo}/pulls/#{number}/reviews", options
end
|
Create a pull request review
@param repo [Integer, String, Hash, Repository] A GitHub repository
@param number [Integer] Number ID of the pull request
@param options [Hash] Method options
@option options [String] :event The review action (event) to perform;
can be one of APPROVE, REQUEST_CHANGES, or COMMENT.
If left blank, the review is left PENDING.
@option options [String] :body The body text of the pull request review
@option options [Array<Hash>] :comments Comments part of the review
@option comments [String] :path The path to the file being commented on
@option comments [Integer] :position The position in the file to be commented on
@option comments [String] :body Body of the comment
@see https://developer.github.com/v3/pulls/reviews/#create-a-pull-request-review
@example
comments = [
{ path: '.travis.yml', position: 10, body: 'ruby-head is under development that is not stable.' },
{ path: '.travis.yml', position: 32, body: 'ruby-head is also required in thervm section.' },
]
options = { event: 'REQUEST_CHANGES', comments: comments }
@client.create_pull_request_review('octokit/octokit.rb', 844, options)
@return [Sawyer::Resource>] Hash respresenting the review
|
create_pull_request_review
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/reviews.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/reviews.rb
|
Apache-2.0
|
def dismiss_pull_request_review(repo, number, review, message, options = {})
options = options.merge(message: message)
put "#{Repository.path repo}/pulls/#{number}/reviews/#{review}/dismissals", options
end
|
Dismiss a pull request review
@param repo [Integer, String, Hash, Repository] A GitHub repository
@param number [Integer] Number ID of the pull request
@param review [Integer] The id of the review
@param message [String] The message for the pull request review dismissal
@see https://developer.github.com/v3/pulls/reviews/#dismiss-a-pull-request-review
@example
@client.dismiss_pull_request_review('octokit/octokit.rb', 825, 6505518, 'The message.')
@return [Sawyer::Resource] Hash representing the dismissed review
|
dismiss_pull_request_review
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/reviews.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/reviews.rb
|
Apache-2.0
|
def pull_request_review_requests(repo, number, options = {})
paginate "#{Repository.path repo}/pulls/#{number}/requested_reviewers", options
end
|
List review requests
@param repo [Integer, String, Hash, Repository] A GitHub repository
@param number [Integer] Number ID of the pull request
@see https://developer.github.com/v3/pulls/review_requests/#list-review-requests
@example
@client.pull_request_review_requests('octokit/octokit.rb', 2)
@return [Array<Sawyer::Resource>] Array of Hashes representing the review requests
|
pull_request_review_requests
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/reviews.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/reviews.rb
|
Apache-2.0
|
def request_pull_request_review(repo, number, reviewers = {}, options = {})
# TODO(5.0): remove deprecated behavior
if reviewers.is_a?(Array)
octokit_warn(
'Deprecated: Octokit::Client#request_pull_request_review '\
"no longer takes a separate :reviewers argument.\n" \
'Please update your call to pass :reviewers and :team_reviewers as part of the options hash.'
)
options = options.merge(reviewers: reviewers)
else
options = options.merge(reviewers)
end
post "#{Repository.path repo}/pulls/#{number}/requested_reviewers", options
end
|
Create a review request
@param repo [Integer, String, Hash, Repository] A GitHub repository
@param number [Integer] Number ID of the pull request
@param reviewers [Hash] :reviewers [Array<String>] An array of user logins
@param options [Hash] :team_reviewers [Array<String>] An array of team slugs
@see https://developer.github.com/v3/pulls/review_requests/#create-a-review-request
@example
@client.request_pull_request_review('octokit/octokit.rb', 2, reviewers: ['soudy'])
@return [Sawyer::Resource>] Hash respresenting the pull request
|
request_pull_request_review
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/reviews.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/reviews.rb
|
Apache-2.0
|
def delete_pull_request_review_request(repo, id, reviewers = {}, options = {})
# TODO(5.0): remove deprecated behavior
if !reviewers.empty? && !options.empty?
octokit_warn(
'Deprecated: Octokit::Client#delete_pull_request_review_request '\
"no longer takes a separate :reviewers argument.\n" \
'Please update your call to pass :reviewers and :team_reviewers as part of the options hash.'
)
end
# For backwards compatibility, this endpoint can be called with a separate reviewers hash.
# If not called with a separate hash, then 'reviewers' is, in fact, 'options'.
options = options.merge(reviewers)
delete "#{Repository.path repo}/pulls/#{id}/requested_reviewers", options
end
|
Delete a review request
@param repo [Integer, String, Hash, Repository] A GitHub repository
@param id [Integer] The id of the pull request
@param reviewers [Hash] :reviewers [Array] An array of user logins
@param options [Hash] :team_reviewers [Array] An array of team slugs
@see https://developer.github.com/v3/pulls/review_requests/#delete-a-review-request
@example
options = {
"reviewers" => [ "octocat", "hubot", "other_user" ],
"team_reviewers" => [ "justice-league" ]
}
@client.delete_pull_request_review_request('octokit/octokit.rb', 2, options)
@return [Sawyer::Resource>] Hash representing the pull request
|
delete_pull_request_review_request
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/reviews.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/reviews.rb
|
Apache-2.0
|
def update_pull_request_review(repo, number, review, body, options = {})
options[:body] = body
put "#{Repository.path repo}/pulls/#{number}/reviews/#{review}", options
end
|
Update a review request comment
@param repo [Integer, String, Hash, Repository] A GitHub repository
@param number [Integer] Number ID of the pull request
@param review [Integer] The id of the review
@param body [String] body text of the pull request review.
@param options [Hash] Method options
@see https://developer.github.com/v3/pulls/reviews/#update-a-pull-request-review
@example
@client.update_pull_request_review('octokit/octokit.rb', 825, 6505518, 'This is close to perfect! Please address the suggested inline change. And add more about this.')
@return [Sawyer::Resource] Hash representing the review comment
|
update_pull_request_review
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/reviews.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/reviews.rb
|
Apache-2.0
|
def say(text = nil, options = {})
options[:s] = text if text
get 'octocat', options
end
|
Return a nifty ASCII Octocat with GitHub wisdom
or your own
@return [String]
|
say
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/say.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/say.rb
|
Apache-2.0
|
def search_code(query, options = {})
search 'search/code', query, options
end
|
Search code
@param query [String] Search term and qualifiers
@param options [Hash] Sort and pagination options
@option options [String] :sort Sort field
@option options [String] :order Sort order (asc or desc)
@option options [Integer] :page Page of paginated results
@option options [Integer] :per_page Number of items per page
@return [Sawyer::Resource] Search results object
@see https://developer.github.com/v3/search/#search-code
|
search_code
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/search.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/search.rb
|
Apache-2.0
|
def search_issues(query, options = {})
search 'search/issues', query, options
end
|
Search issues
@param query [String] Search term and qualifiers
@param options [Hash] Sort and pagination options
@option options [String] :sort Sort field
@option options [String] :order Sort order (asc or desc)
@option options [Integer] :page Page of paginated results
@option options [Integer] :per_page Number of items per page
@return [Sawyer::Resource] Search results object
@see https://developer.github.com/v3/search/#search-issues-and-pull-requests
|
search_issues
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/search.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/search.rb
|
Apache-2.0
|
def search_repositories(query, options = {})
search 'search/repositories', query, options
end
|
Search repositories
@param query [String] Search term and qualifiers
@param options [Hash] Sort and pagination options
@option options [String] :sort Sort field
@option options [String] :order Sort order (asc or desc)
@option options [Integer] :page Page of paginated results
@option options [Integer] :per_page Number of items per page
@return [Sawyer::Resource] Search results object
@see https://developer.github.com/v3/search/#search-repositories
|
search_repositories
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/search.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/search.rb
|
Apache-2.0
|
def search_users(query, options = {})
search 'search/users', query, options
end
|
Search users
@param query [String] Search term and qualifiers
@param options [Hash] Sort and pagination options
@option options [String] :sort Sort field
@option options [String] :order Sort order (asc or desc)
@option options [Integer] :page Page of paginated results
@option options [Integer] :per_page Number of items per page
@return [Sawyer::Resource] Search results object
@see https://developer.github.com/v3/search/#search-users
|
search_users
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/search.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/search.rb
|
Apache-2.0
|
def start_source_import(*args)
arguments = Octokit::RepoArguments.new(args)
vcs_url = arguments.pop
vcs = arguments.pop
if vcs
octokit_warn 'Octokit#start_source_import vcs parameter is now an option, please update your call before the next major Octokit version update.'
arguments.options.merge!(vcs: vcs)
end
options = ensure_api_media_type(:source_imports, arguments.options.merge(vcs_url: vcs_url))
put "#{Repository.path arguments.repo}/import", options
end
|
Start a source import to a GitHub repository using GitHub Importer.
@overload start_source_import(repo, vcs, vcs_url, options = {})
@deprecated
@param repo [Integer, String, Hash, Repository] A GitHub repository.
@param vcs [String] The originating VCS type. Can be one of "subversion", "git", "mercurial", or "tfvc".
@param vcs_url [String] The URL of the originating repository.
@param options [Hash]
@option options [String] :vcs_username If authentication is required, the username to provide to vcs_url.
@option options [String] :vcs_password If authentication is required, the password to provide to vcs_url.
@option options [String] :tfvc_project For a tfvc import, the name of the project that is being imported.
@overload start_source_import(repo, vcs_url, options = {})
@param repo [Integer, String, Hash, Repository] A GitHub repository.
@param vcs_url [String] The URL of the originating repository.
@param options [Hash]
@param options [String] :vcs The originating VCS type. Can be one of "subversion", "git", "mercurial", or "tfvc".
@option options [String] :vcs_username If authentication is required, the username to provide to vcs_url.
@option options [String] :vcs_password If authentication is required, the password to provide to vcs_url.
@option options [String] :tfvc_project For a tfvc import, the name of the project that is being imported.
@return [Sawyer::Resource] Hash representing the repository import
@see https://developer.github.com/v3/migration/source_imports/#start-an-import
@example
@client.start_source_import("octokit/octokit.rb", "http://svn.mycompany.com/svn/myproject", {
:vcs => "subversion",
:vcs_username" => "octocat",
:vcs_password => "secret"
})
|
start_source_import
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/source_import.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/source_import.rb
|
Apache-2.0
|
def source_import_progress(repo, options = {})
options = ensure_api_media_type(:source_imports, options)
get "#{Repository.path repo}/import", options
end
|
View the progress of an import.
@param repo [Integer, String, Hash, Repository] A GitHub repository.
@return [Sawyer::Resource] Hash representing the progress of the import
@see https://developer.github.com/v3/migration/source_imports/#get-import-progress
@example
@client.source_import_progress("octokit/octokit.rb")
|
source_import_progress
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/source_import.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/source_import.rb
|
Apache-2.0
|
def update_source_import(repo, options = {})
options = ensure_api_media_type(:source_imports, options)
patch "#{Repository.path repo}/import", options
end
|
Update source import with authentication or project choice
Restart source import if no options are passed
@param repo [Integer, String, Hash, Repository] A GitHub repository.
@return [Sawyer::Resource] Hash representing the repository import
@see https://developer.github.com/v3/migration/source_imports/#update-existing-import
@option options [String] :vcs_username If authentication is required, the username to provide to vcs_url.
@option options [String] :vcs_password If authentication is required, the password to provide to vcs_url.
@option options [String] To update project choice, please refer to the project_choice array from the progress return hash for the exact attributes.
https://developer.github.com/v3/migration/source_imports/#update-existing-import
@example
@client.update_source_import("octokit/octokit.rb", {
:vcs_username" => "octocat",
:vcs_password => "secret"
})
|
update_source_import
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/source_import.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/source_import.rb
|
Apache-2.0
|
def cancel_source_import(repo, options = {})
options = ensure_api_media_type(:source_imports, options)
boolean_from_response :delete, "#{Repository.path repo}/import", options
end
|
Stop an import for a repository.
@param repo [Integer, String, Hash, Repository] A GitHub repository.
@return [Boolean] True if the import has been cancelled, false otherwise.
@see https://developer.github.com/v3/migration/source_imports/#cancel-an-import
@example
@client.cancel_source_import("octokit/octokit.rb")
|
cancel_source_import
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/source_import.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/source_import.rb
|
Apache-2.0
|
def source_import_large_files(repo, options = {})
options = ensure_api_media_type(:source_imports, options)
get "#{Repository.path repo}/import/large_files", options
end
|
List source import large files
@param repo [Integer, String, Hash, Repository] A GitHub repository.
@param options [Hash]
@option options [Integer] :page Page of paginated results
@return [Array<Sawyer::Resource>] Array of hashes representing files over 100MB.
@see https://developer.github.com/v3/migration/source_imports/#get-large-files
@example
@client.source_import_large_files("octokit/octokit.rb")
|
source_import_large_files
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/source_import.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/source_import.rb
|
Apache-2.0
|
def set_source_import_lfs_preference(repo, use_lfs, options = {})
options = ensure_api_media_type(:source_imports, options.merge(use_lfs: use_lfs))
patch "#{Repository.path repo}/import/lfs", options
end
|
Set preference for using Git LFS to import files over 100MB
@param repo [Integer, String, Hash, Repository] A GitHub repository.
@param use_lfs [String] Preference for using Git LFS to import large files. Can be one of "opt_in" or "opt_out"
@return [Sawyer::Resource] Hash representing the repository import
@see https://developer.github.com/v3/migration/source_imports/#set-git-lfs-preference
@example
@client.opt_in_source_import_lfs("octokit/octokit.rb", "opt_in")
|
set_source_import_lfs_preference
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/source_import.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/source_import.rb
|
Apache-2.0
|
def code_frequency_stats(repo, options = {})
get_stats(repo, 'code_frequency', options)
end
|
Get the number of additions and deletions per week
@param repo [Integer, String, Hash, Repository] A GitHub repository
@option retry_timeout [Number] How long Octokit should keep trying to get stats (in seconds)
@option retry_wait [Number] How long Octokit should wait between retries.
@return [Array<Sawyer::Resource>] Weekly aggregate of the number of additions
and deletions pushed to a repository.
@see https://developer.github.com/v3/repos/statistics/#get-the-number-of-additions-and-deletions-per-week
@example Get code frequency stats for octokit
@client.code_frequency_stats('octokit/octokit.rb')
|
code_frequency_stats
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/stats.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/stats.rb
|
Apache-2.0
|
def top_referrers(repo, options = {})
opts = ensure_api_media_type(:traffic, options)
get "#{Repository.path repo}/traffic/popular/referrers", opts
end
|
Get the top 10 referrers over the last 14 days
@param repo [Integer, String, Repository, Hash] A GitHub repository
@return [Array<Sawyer::Resource>] List of referrers and stats
@see https://developer.github.com/v3/repos/traffic/#list-referrers
@example
@client.top_referrers('octokit/octokit.rb')
|
top_referrers
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/traffic.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/traffic.rb
|
Apache-2.0
|
def top_paths(repo, options = {})
opts = ensure_api_media_type(:traffic, options)
get "#{Repository.path repo}/traffic/popular/paths", opts
end
|
Get the top 10 popular contents over the last 14 days
@param repo [Integer, String, Repository, Hash] A GitHub repository
@return [Array<Sawyer::Resource>] List of popular contents
@see https://developer.github.com/v3/repos/traffic/#list-paths
@example
@client.top_paths('octokit/octokit.rb')
|
top_paths
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/traffic.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/traffic.rb
|
Apache-2.0
|
def views(repo, options = {})
opts = ensure_api_media_type(:traffic, options)
get "#{Repository.path repo}/traffic/views", opts
end
|
Get the total number of views and breakdown per day or week for the
last 14 days
@param repo [Integer, String, Repository, Hash] A GitHub Repository
@option options [String] :per ('day') Views per. <tt>day</tt> or
<tt>week</tt>
@return [Sawyer::Resource] Breakdown of view stats
@see https://developer.github.com/v3/repos/traffic/#views
@example Views per day
@client.views('octokit/octokit.rb')
@example Views per week
@client.views('octokit/octokit.rb', per: 'week')
|
views
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/traffic.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/traffic.rb
|
Apache-2.0
|
def clones(repo, options = {})
opts = ensure_api_media_type(:traffic, options)
get "#{Repository.path repo}/traffic/clones", opts
end
|
Get the total number of clones and breakdown per day or week for the
last 14 days
@param repo [Integer, String, Repository, Hash] A GitHub Repository
@option options [String] :per ('day') Views per. <tt>day</tt> or
<tt>week</tt>
@return [Sawyer::Resource] Breakdown of clone stats
@see https://developer.github.com/v3/repos/traffic/#clones
@example Clones per day
@client.clones('octokit/octokit.rb')
@example Clones per week
@client.clones('octokit/octokit.rb', per: 'week')
|
clones
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/traffic.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/client/traffic.rb
|
Apache-2.0
|
def admin_stats
get_admin_stats 'all'
end
|
Get all available stats
@return [Sawyer::Resource] All available stats
@example Get all available stats
@client.admin_stats
|
admin_stats
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/admin_stats.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/admin_stats.rb
|
Apache-2.0
|
def admin_repository_stats
get_admin_stats 'repos'
end
|
Get only repository-related stats
@return [Sawyer::Resource] Only repository-related stats
@example Get only repository-related stats
@client.admin_repository_stats
|
admin_repository_stats
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/admin_stats.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/admin_stats.rb
|
Apache-2.0
|
def admin_hooks_stats
get_admin_stats 'hooks'
end
|
Get only hooks-related stats
@return [Sawyer::Resource] Only hooks-related stats
@example Get only hooks-related stats
@client.admin_hooks_stats
|
admin_hooks_stats
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/admin_stats.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/admin_stats.rb
|
Apache-2.0
|
def admin_pages_stats
get_admin_stats 'pages'
end
|
Get only pages-related stats
@return [Sawyer::Resource] Only pages-related stats
@example Get only pages-related stats
@client.admin_pages_stats
|
admin_pages_stats
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/admin_stats.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/admin_stats.rb
|
Apache-2.0
|
def admin_organization_stats
get_admin_stats 'orgs'
end
|
Get only organization-related stats
@return [Sawyer::Resource] Only organization-related stats
@example Get only organization-related stats
@client.admin_organization_stats
|
admin_organization_stats
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/admin_stats.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/admin_stats.rb
|
Apache-2.0
|
def admin_users_stats
get_admin_stats 'users'
end
|
Get only user-related stats
@return [Sawyer::Resource] Only user-related stats
@example Get only user-related stats
@client.admin_users_stats
|
admin_users_stats
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/admin_stats.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/admin_stats.rb
|
Apache-2.0
|
def admin_pull_requests_stats
get_admin_stats 'pulls'
end
|
Get only pull request-related stats
@return [Sawyer::Resource] Only pull request-related stats
@example Get only pull request-related stats
@client.admin_pull_requests_stats
|
admin_pull_requests_stats
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/admin_stats.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/admin_stats.rb
|
Apache-2.0
|
def admin_issues_stats
get_admin_stats 'issues'
end
|
Get only issue-related stats
@return [Sawyer::Resource] Only issue-related stats
@example Get only issue-related stats
@client.admin_issues_stats
|
admin_issues_stats
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/admin_stats.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/admin_stats.rb
|
Apache-2.0
|
def admin_milestones_stats
get_admin_stats 'milestones'
end
|
Get only milestone-related stats
@return [Sawyer::Resource] Only milestone-related stats
@example Get only milestone-related stats
@client.admin_milestones_stats
|
admin_milestones_stats
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/admin_stats.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/admin_stats.rb
|
Apache-2.0
|
def admin_gists_stats
get_admin_stats 'gists'
end
|
Get only gist-related stats
@return [Sawyer::Resource] Only only gist-related stats
@example Get only gist-related stats
@client.admin_gits_stats
|
admin_gists_stats
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/admin_stats.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/admin_stats.rb
|
Apache-2.0
|
def admin_comments_stats
get_admin_stats 'comments'
end
|
Get only comment-related stats
@return [Sawyer::Resource] Only comment-related stats
@example Get only comment-related stats
@client.admin_comments_stats
|
admin_comments_stats
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/admin_stats.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/admin_stats.rb
|
Apache-2.0
|
def get_admin_stats(metric)
get "enterprise/stats/#{metric}"
end
|
@private Get enterprise stats
@param metric [String] The metrics you are looking for
@return [Sawyer::Resource] Magical unicorn stats
|
get_admin_stats
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/admin_stats.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/admin_stats.rb
|
Apache-2.0
|
def create_organization(login, admin, options = {})
options[:login] = login
options[:admin] = admin
post 'admin/organizations', options
end
|
Create a new organization on the instance.
@param login [String] The organization's username.
@param admin [String] The login of the user who will manage this organization.
@param options [Hash] A set of options.
@option options [String] :profile_name The organization's display name.
@return [nil]
@see https://developer.github.com/v3/enterprise-admin/orgs/#create-an-organization
@example
@admin_client.create_organization('SuchAGreatOrg', 'gjtorikian')
|
create_organization
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/orgs.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/orgs.rb
|
Apache-2.0
|
def index_user(user)
queue_index user
end
|
Queue a User or Organization to be indexed
@param user [String] A GitHub Enterprise user or organization
@return [Sawyer:Resource] Result of the queuing containing `:message`
|
index_user
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/search_indexing.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/search_indexing.rb
|
Apache-2.0
|
def index_repository(repo)
queue_index Repository.new repo
end
|
Queue a Repository to be indexed
@param repo [String, Hash, Repository] A GitHub repository
@return [Sawyer:Resource] Result of the queuing containing `:message`
|
index_repository
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/search_indexing.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/search_indexing.rb
|
Apache-2.0
|
def index_repository_issues(repo)
queue_index "#{Repository.new repo}/issues"
end
|
Queue a repository's Issues to be indexed
@param repo [String, Hash, Repository] A GitHub repository
@return [Sawyer:Resource] Result of the queuing containing `:message`
|
index_repository_issues
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/search_indexing.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/search_indexing.rb
|
Apache-2.0
|
def index_repository_code(repo)
queue_index "#{Repository.new repo}/code"
end
|
Queue a repository's code to be indexed
@param repo [String, Hash, Repository] A GitHub repository
@return [Sawyer:Resource] Result of the queuing containing `:message`
|
index_repository_code
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/search_indexing.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/search_indexing.rb
|
Apache-2.0
|
def index_users_repositories(user)
queue_index "#{user}/*"
end
|
Queue a user's or organization's repositories to be indexed
@param user [String] A GitHub Enterprise user or organization
@return [Sawyer:Resource] Result of the queuing containing `:message`
|
index_users_repositories
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/search_indexing.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/search_indexing.rb
|
Apache-2.0
|
def index_users_repositories_issues(user)
queue_index "#{user}/*/issues"
end
|
Queue an index of all the issues across all of a user's or
organization's repositories
@param user [String] A GitHub Enterprise user or organization
@return [Sawyer:Resource] Result of the queuing containing `:message`
|
index_users_repositories_issues
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/search_indexing.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/search_indexing.rb
|
Apache-2.0
|
def index_users_repositories_code(user)
queue_index "#{user}/*/code"
end
|
Queue an index of all the code contained in all of a user's or
organization's repositories
@param user [String] A GitHub Enterprise user or organization
@return [Sawyer:Resource] Result of the queuing containing `:message`
|
index_users_repositories_code
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/search_indexing.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/search_indexing.rb
|
Apache-2.0
|
def queue_index(target)
post 'staff/indexing_jobs', target: target
end
|
@private Queue a target for indexing
@param target [String] Target to index
@return [Sawyer:Resource] Result of the queuing containing `:message`
|
queue_index
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/search_indexing.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/search_indexing.rb
|
Apache-2.0
|
def create_user(login, email, options = {})
options[:login] = login
options[:email] = email
post 'admin/users', options
end
|
Create a new user.
@param login [String] The user's username.
@param email [String] The user's email address.
@see https://developer.github.com/enterprise/v3/enterprise-admin/users#create-a-new-user
@example
@admin_client.create_user('foobar', '[email protected]')
|
create_user
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/users.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/users.rb
|
Apache-2.0
|
def promote(user, options = {})
boolean_from_response :put, "users/#{user}/site_admin", options
end
|
Promote an ordinary user to a site administrator
@param user [String] Username of the user to promote.
@return [Boolean] True if promote was successful, false otherwise.
@see https://developer.github.com/enterprise/v3/enterprise-admin/users/#promote-an-ordinary-user-to-a-site-administrator
@example
@admin_client.promote('holman')
|
promote
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/users.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/users.rb
|
Apache-2.0
|
def demote(user, options = {})
boolean_from_response :delete, "users/#{user}/site_admin", options
end
|
Demote a site administrator to an ordinary user
@param user [String] Username of the user to demote.
@return [Boolean] True if demote was successful, false otherwise.
@see https://developer.github.com/enterprise/v3/enterprise-admin/users/#demote-a-site-administrator-to-an-ordinary-user
@example
@admin_client.demote('holman')
|
demote
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/users.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/users.rb
|
Apache-2.0
|
def rename_user(old_login, new_login, options = {})
options[:login] = new_login
patch "admin/users/#{old_login}", options
end
|
Rename a user.
@param old_login [String] The user's old username.
@param new_login [String] The user's new username.
@see https://developer.github.com/enterprise/v3/enterprise-admin/users/#rename-an-existing-user
@example
@admin_client.rename_user('foobar', 'foofoobar')
|
rename_user
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/users.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/users.rb
|
Apache-2.0
|
def delete_user(username, options = {})
boolean_from_response :delete, "admin/users/#{username}", options
end
|
Deletes a user.
@param username [String] The username to delete.
@see https://developer.github.com/enterprise/v3/enterprise-admin/users/#delete-a-user
@example
@admin_client.delete_key(1)
|
delete_user
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/users.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/users.rb
|
Apache-2.0
|
def suspend(user, options = {})
boolean_from_response :put, "users/#{user}/suspended", options
end
|
Suspend a user.
@param user [String] Username of the user to suspend.
@return [Boolean] True if suspend was successful, false otherwise.
@see https://developer.github.com/enterprise/v3/enterprise-admin/users/#suspend-a-user
@example
@admin_client.suspend('holman')
|
suspend
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/users.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/users.rb
|
Apache-2.0
|
def unsuspend(user, options = {})
boolean_from_response :delete, "users/#{user}/suspended", options
end
|
Unsuspend a user.
@param user [String] Username of the user to unsuspend.
@return [Boolean] True if unsuspend was successful, false otherwise.
@see https://developer.github.com/enterprise/v3/enterprise-admin/users/#unsuspend-a-user
@example
@admin_client.unsuspend('holman')
|
unsuspend
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/users.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/users.rb
|
Apache-2.0
|
def create_impersonation_token(login, options = {})
post "admin/users/#{login}/authorizations", options
end
|
Creates an impersonation OAuth token.
@param login [String] The user to create a token for.
@param options [Array<String>] :scopes The scopes to apply.
@see https://developer.github.com/enterprise/v3/enterprise-admin/users/#create-an-impersonation-oauth-token
@example
@admin_client.create_impersonation_token('foobar', {:scopes => ['repo:write']})
|
create_impersonation_token
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/users.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/users.rb
|
Apache-2.0
|
def delete_impersonation_token(login, options = {})
boolean_from_response :delete, "admin/users/#{login}/authorizations", options
end
|
Deletes an impersonation OAuth token.
@param login [String] The user whose token should be deleted.
@see https://developer.github.com/enterprise/v3/enterprise-admin/users/#delete-an-impersonation-oauth-token
@example
@admin_client.delete_impersonation_token('foobar')
|
delete_impersonation_token
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/users.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/users.rb
|
Apache-2.0
|
def list_all_keys(options = {})
get 'admin/keys', options
end
|
Lists all the public SSH keys.
@see https://developer.github.com/enterprise/v3/enterprise-admin/users/#list-all-public-keys
@example
@admin_client.list_all_keys
|
list_all_keys
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/users.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/users.rb
|
Apache-2.0
|
def delete_key(id, options = {})
boolean_from_response :delete, "admin/keys/#{id}", options
end
|
Deletes a public SSH keys.
@param id [Number] The ID of the key to delete.
@see https://developer.github.com/enterprise/v3/enterprise-admin/users/#delete-a-public-key
@example
@admin_client.delete_key(1)
|
delete_key
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/users.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_admin_client/users.rb
|
Apache-2.0
|
def config_status
get '/setup/api/configcheck', password_hash
end
|
Get information about the Enterprise installation
@return [Sawyer::Resource] The installation information
|
config_status
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_management_console_client/management_console.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_management_console_client/management_console.rb
|
Apache-2.0
|
def settings
get '/setup/api/settings', password_hash
end
|
Get information about the Enterprise installation
@return [Sawyer::Resource] The settings
|
settings
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_management_console_client/management_console.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_management_console_client/management_console.rb
|
Apache-2.0
|
def edit_settings(settings)
queries = password_hash
queries[:query][:settings] = settings.to_json.to_s
put '/setup/api/settings', queries
end
|
Modify the Enterprise settings
@param settings [Hash] A hash configuration of the new settings
@return [nil]
|
edit_settings
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_management_console_client/management_console.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_management_console_client/management_console.rb
|
Apache-2.0
|
def maintenance_status
get '/setup/api/maintenance', password_hash
end
|
Get information about the Enterprise maintenance status
@return [Sawyer::Resource] The maintenance status
|
maintenance_status
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_management_console_client/management_console.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_management_console_client/management_console.rb
|
Apache-2.0
|
def set_maintenance_status(maintenance)
queries = password_hash
queries[:query][:maintenance] = maintenance.to_json.to_s
post '/setup/api/maintenance', queries
end
|
Start (or turn off) the Enterprise maintenance mode
@param maintenance [Hash] A hash configuration of the maintenance settings
@return [nil]
|
set_maintenance_status
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_management_console_client/management_console.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_management_console_client/management_console.rb
|
Apache-2.0
|
def authorized_keys
get '/setup/api/settings/authorized-keys', password_hash
end
|
Fetch the authorized SSH keys on the Enterprise install
@return [Sawyer::Resource] An array of authorized SSH keys
|
authorized_keys
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_management_console_client/management_console.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_management_console_client/management_console.rb
|
Apache-2.0
|
def add_authorized_key(key)
queries = password_hash
case key
when String
if File.exist?(key)
key = File.open(key, 'r')
content = key.read.strip
key.close
else
content = key
end
when File
content = key.read.strip
key.close
end
queries[:query][:authorized_key] = content
post '/setup/api/settings/authorized-keys', queries
end
|
Add an authorized SSH keys on the Enterprise install
@param key Either the file path to a key, a File handler to the key, or the contents of the key itself
@return [Sawyer::Resource] An array of authorized SSH keys
|
add_authorized_key
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_management_console_client/management_console.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_management_console_client/management_console.rb
|
Apache-2.0
|
def remove_authorized_key(key)
queries = password_hash
case key
when String
if File.exist?(key)
key = File.open(key, 'r')
content = key.read.strip
key.close
else
content = key
end
when File
content = key.read.strip
key.close
end
queries[:query][:authorized_key] = content
delete '/setup/api/settings/authorized-keys', queries
end
|
Removes an authorized SSH keys from the Enterprise install
@param key Either the file path to a key, a File handler to the key, or the contents of the key itself
@return [Sawyer::Resource] An array of authorized SSH keys
|
remove_authorized_key
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_management_console_client/management_console.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/octokit-4.25.1/lib/octokit/enterprise_management_console_client/management_console.rb
|
Apache-2.0
|
def close_pipes
read.close unless read.closed?
write.close unless write.closed?
end
|
might be passed to started_processes and simultaneously closed by another thread
when running in isolation mode, so we have to check if it is closed before closing
|
close_pipes
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/parallel-1.23.0/lib/parallel.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/parallel-1.23.0/lib/parallel.rb
|
Apache-2.0
|
def pack(item, index)
producer? ? [item, index] : index
end
|
generate item that is sent to workers
just index is faster + less likely to blow up with unserializable errors
|
pack
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/parallel-1.23.0/lib/parallel.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/parallel-1.23.0/lib/parallel.rb
|
Apache-2.0
|
def unpack(data)
producer? ? data : [@source[data], data]
end
|
unpack item that is sent to workers
|
unpack
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/parallel-1.23.0/lib/parallel.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/parallel-1.23.0/lib/parallel.rb
|
Apache-2.0
|
def kill_on_ctrl_c(pids, options)
@to_be_killed ||= []
old_interrupt = nil
signal = options.fetch(:interrupt_signal, INTERRUPT_SIGNAL)
if @to_be_killed.empty?
old_interrupt = trap_interrupt(signal) do
warn 'Parallel execution interrupted, exiting ...'
@to_be_killed.flatten.each { |pid| kill(pid) }
end
end
@to_be_killed << pids
yield
ensure
@to_be_killed.pop # do not kill pids that could be used for new processes
restore_interrupt(old_interrupt, signal) if @to_be_killed.empty?
end
|
kill all these pids or threads if user presses Ctrl+c
|
kill_on_ctrl_c
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/parallel-1.23.0/lib/parallel.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/parallel-1.23.0/lib/parallel.rb
|
Apache-2.0
|
def physical_processor_count
@physical_processor_count ||= begin
ppc =
case RbConfig::CONFIG["target_os"]
when /darwin[12]/
IO.popen("/usr/sbin/sysctl -n hw.physicalcpu").read.to_i
when /linux/
cores = {} # unique physical ID / core ID combinations
phy = 0
File.read("/proc/cpuinfo").scan(/^physical id.*|^core id.*/) do |ln|
if ln.start_with?("physical")
phy = ln[/\d+/]
elsif ln.start_with?("core")
cid = "#{phy}:#{ln[/\d+/]}"
cores[cid] = true unless cores[cid]
end
end
cores.count
when /mswin|mingw/
require 'win32ole'
result_set = WIN32OLE.connect("winmgmts://").ExecQuery(
"select NumberOfCores from Win32_Processor"
)
result_set.to_enum.collect(&:NumberOfCores).reduce(:+)
else
processor_count
end
# fall back to logical count if physical info is invalid
ppc > 0 ? ppc : processor_count
end
end
|
Number of physical processor cores on the current system.
|
physical_processor_count
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/parallel-1.23.0/lib/parallel.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/parallel-1.23.0/lib/parallel.rb
|
Apache-2.0
|
def processor_count
require 'etc'
@processor_count ||= Integer(ENV['PARALLEL_PROCESSOR_COUNT'] || Etc.nprocessors)
end
|
Number of processors seen by the OS, used for process scheduling
|
processor_count
|
ruby
|
collabnix/kubelabs
|
.bundles_cache/ruby/2.6.0/gems/parallel-1.23.0/lib/parallel.rb
|
https://github.com/collabnix/kubelabs/blob/master/.bundles_cache/ruby/2.6.0/gems/parallel-1.23.0/lib/parallel.rb
|
Apache-2.0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.