Files
news.gitea.happylizard.me/bin/gems/octokit-6.1.1/lib/octokit/client/licenses.rb
T
pizza2d1 4cee170d66
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 9s
Add bin and edit workflow
2026-09-16 13:11:16 -06:00

43 lines
1.4 KiB
Ruby
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# frozen_string_literal: true
module Octokit
class Client
# Methods for licenses API
#
module Licenses
# List all licenses
#
# @see https://developer.github.com/v3/licenses/#list-all-licenses
# @return [Array<Sawyer::Resource>] A list of licenses
# @example
# Octokit.licenses
def licenses(options = {})
paginate 'licenses', options
end
# List an individual license
#
# @see https://developer.github.com/v3/licenses/#get-an-individual-license
# @param license_name [String] The license name
# @return <Sawyer::Resource> An individual license
# @example
# Octokit.license 'mit'
def license(license_name, options = {})
get "licenses/#{license_name}", options
end
# Returns the contents of the repository’s license file, if one is detected.
#
# @see https://developer.github.com/v3/licenses/#get-the-contents-of-a-repositorys-license
# @param repo [Integer, String, Repository, Hash] A GitHub repository
# @option options [String] :ref name of the Commit/Branch/Tag. Defaults to 'master'.
# @return [Sawyer::Resource] The detail of the license file
# @example
# Octokit.repository_license_contents 'benbalter/licensee'
def repository_license_contents(repo, options = {})
get "#{Repository.path repo}/license", options
end
end
end
end