Class: Neetob::CLI::Github::Labels::Update
- Defined in:
- lib/neetob/cli/github/labels/update.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary collapse
-
#new_name ⇒ Object
Returns the value of attribute new_name.
-
#old_name ⇒ Object
Returns the value of attribute old_name.
-
#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, old_name, new_name, sandbox = false) ⇒ Update
constructor
A new instance of Update.
- #run ⇒ Object
Methods included from Utils
#camel_case_to_slug, #is_upper?, #symbolize_keys
Constructor Details
#initialize(repos, old_name, new_name, sandbox = false) ⇒ Update
Returns a new instance of Update.
14 15 16 17 18 19 20 |
# File 'lib/neetob/cli/github/labels/update.rb', line 14 def initialize(repos, old_name, new_name, sandbox = false) super() @repos = repos @sandbox = sandbox @old_name = old_name @new_name = new_name end |
Instance Attribute Details
#new_name ⇒ Object
Returns the value of attribute new_name.
12 13 14 |
# File 'lib/neetob/cli/github/labels/update.rb', line 12 def new_name @new_name end |
#old_name ⇒ Object
Returns the value of attribute old_name.
12 13 14 |
# File 'lib/neetob/cli/github/labels/update.rb', line 12 def old_name @old_name end |
#repos ⇒ Object
Returns the value of attribute repos.
12 13 14 |
# File 'lib/neetob/cli/github/labels/update.rb', line 12 def repos @repos end |
#sandbox ⇒ Object
Returns the value of attribute sandbox.
12 13 14 |
# File 'lib/neetob/cli/github/labels/update.rb', line 12 def sandbox @sandbox end |
Instance Method Details
#run ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/neetob/cli/github/labels/update.rb', line 22 def run matching_repos = find_all_matching_apps_or_repos(repos, :github, sandbox) matching_repos.each do |repo| ui.info("\nUpdating label for #{repo} repo \n") begin update_label!(repo, old_name, new_name) rescue Octokit::NotFound ui.say("Ignoring update for #{repo} repo as it doesn't have the \"#{old_name}\" label.") rescue StandardError => e ExceptionHandler.new(e).process end end end |