Class: Neetob::CLI::Github::Labels::Delete
- Defined in:
- lib/neetob/cli/github/labels/delete.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary collapse
-
#labels ⇒ Object
Returns the value of attribute labels.
-
#repos ⇒ Object
Returns the value of attribute repos.
-
#sandbox ⇒ Object
Returns the value of attribute sandbox.
Attributes inherited from Base
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(repos, labels, sandbox = false) ⇒ Delete
constructor
A new instance of Delete.
- #run ⇒ Object
Methods included from Utils
#camel_case_to_slug, #is_upper?, #symbolize_keys
Constructor Details
#initialize(repos, labels, sandbox = false) ⇒ Delete
Returns a new instance of Delete.
14 15 16 17 18 19 |
# File 'lib/neetob/cli/github/labels/delete.rb', line 14 def initialize(repos, labels, sandbox = false) super() @labels = labels @repos = repos @sandbox = sandbox end |
Instance Attribute Details
#labels ⇒ Object
Returns the value of attribute labels.
12 13 14 |
# File 'lib/neetob/cli/github/labels/delete.rb', line 12 def labels @labels end |
#repos ⇒ Object
Returns the value of attribute repos.
12 13 14 |
# File 'lib/neetob/cli/github/labels/delete.rb', line 12 def repos @repos end |
#sandbox ⇒ Object
Returns the value of attribute sandbox.
12 13 14 |
# File 'lib/neetob/cli/github/labels/delete.rb', line 12 def sandbox @sandbox end |
Instance Method Details
#run ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/neetob/cli/github/labels/delete.rb', line 21 def run matching_repos = find_all_matching_apps_or_repos(repos, :github, sandbox) matching_repos.each do |repo| ui.info("\nDeleting labels from #{repo} repo \n") labels.each do |label| begin check_if_label_exist!(repo, label) delete_label(repo, label) rescue Octokit::NotFound ui.say(" ↳The repo doesn't have the label \"#{label}\"") end end end end |