Module: Octokit::Client::Environments
- Included in:
- Octokit::Client
- Defined in:
- lib/octokit/client/environments.rb
Overview
Methods for the Environments API
Instance Method Summary collapse
-
#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.
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
43 44 45 |
# 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
53 54 55 |
# 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
15 16 17 |
# 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
26 27 28 29 30 31 |
# 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 |