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
40 41 42 |
# File 'lib/octokit/client/environments.rb', line 40 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
50 51 52 |
# File 'lib/octokit/client/environments.rb', line 50 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 |
# File 'lib/octokit/client/environments.rb', line 26 def environments(repo, = {}) get("#{Repository.path repo}/environments", ) end |