Module: Octokit::Client::Environments
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Included In:
| |
Defined in: | lib/octokit/client/environments.rb |
Overview
Methods for the Environments
API
Instance Method Summary
-
#create_or_update_environment(repo, environment_name, options = {}) ⇒ Sawyer::Resource
Create or update an environment with protection rules, such as required reviewers.
-
#delete_environment(repo, environment_name, options = {}) ⇒ No Content
Delete an Environment.
-
#environment(repo, environment_name, options = {}) ⇒ Sawyer::Resource
Fetch a single environment for a repository.
-
#environments(repo, options = {}) ⇒ Sawyer::Resource
(also: #list_environments)
Lists the environments for a repository.
-
#list_environments(repo, options = {})
Alias for #environments.
Instance Method Details
#create_or_update_environment(repo, environment_name, options = {}) ⇒ Sawyer::Resource
Create or update an environment with protection rules, such as required reviewers
# File 'lib/octokit/client/environments.rb', line 43
def create_or_update_environment(repo, environment_name, = {}) put("#{Repository.path repo}/environments/#{environment_name}", ) end
#delete_environment(repo, environment_name, options = {}) ⇒ No
Content
Delete an Environment
# File 'lib/octokit/client/environments.rb', line 53
def delete_environment(repo, environment_name, = {}) delete("#{Repository.path repo}/environments/#{environment_name}", ) end
#environment(repo, environment_name, options = {}) ⇒ Sawyer::Resource
Fetch a single environment for a repository
# File 'lib/octokit/client/environments.rb', line 15
def environment(repo, environment_name, = {}) get("#{Repository.path repo}/environments/#{environment_name}", ) end
#environments(repo, options = {}) ⇒ Sawyer::Resource
Also known as: #list_environments
Lists the environments for a repository
# File 'lib/octokit/client/environments.rb', line 26
def environments(repo, = {}) paginate("#{Repository.path repo}/environments", ) do |data, last_response| data.environments.concat last_response.data.environments data.total_count += last_response.data.total_count end end
#list_environments(repo, options = {})
Alias for #environments.
# File 'lib/octokit/client/environments.rb', line 32
alias list_environments environments