This repository has been archived by the owner on Mar 3, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#239 Adding ability to enable/disable issues
- Loading branch information
1 parent
ce7892b
commit f007066
Showing
6 changed files
with
97 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
module GHI | ||
module Commands | ||
class Disable < Command | ||
|
||
def execute | ||
require_repo | ||
patch_data = {} | ||
# TODO: A way to grap the actual repo name, rather than username/repo | ||
repo_path = repo.partition "/" | ||
patch_data[:name] = repo_path[2] | ||
patch_data[:has_issues] = false | ||
res = throb { api.patch "/repos/#{repo}", patch_data }.body | ||
if !res['has_issues'] | ||
puts "Issues are now disabled for this repo" | ||
else | ||
puts "Something went wrong disabling issues for this repo" | ||
end | ||
end | ||
|
||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
module GHI | ||
module Commands | ||
class Enable < Command | ||
|
||
def execute | ||
require_repo | ||
patch_data = {} | ||
# TODO: A way to grap the actual repo name, rather than username/repo | ||
repo_path = repo.partition "/" | ||
patch_data[:name] = repo_path[2] | ||
patch_data[:has_issues] = true | ||
res = throb { api.patch "/repos/#{repo}", patch_data }.body | ||
if res['has_issues'] | ||
puts "Issues are now enabled for this repo" | ||
else | ||
puts "Something went wrong enabling issues for this repo" | ||
end | ||
end | ||
|
||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters