Class: Neetob::CLI::Github::Labels::Upsert
- Defined in:
- lib/neetob/cli/github/labels/upsert.rb
Constant Summary collapse
- WHITE_COLOR_HEX_CODE =
"ffffff"
Constants inherited from Base
Instance Attribute Summary collapse
-
#color ⇒ Object
Returns the value of attribute color.
-
#description ⇒ Object
Returns the value of attribute description.
-
#name ⇒ Object
Returns the value of attribute name.
-
#repos ⇒ Object
Returns the value of attribute repos.
-
#required_labels_json_file_path ⇒ Object
Returns the value of attribute required_labels_json_file_path.
-
#sandbox ⇒ Object
Returns the value of attribute sandbox.
Attributes inherited from Base
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(repos, required_labels_json_file_path = "", sandbox = false, name = "", color = "", description = "") ⇒ Upsert
constructor
A new instance of Upsert.
- #run ⇒ Object
Methods included from Utils
#camel_case_to_slug, #is_upper?, #symbolize_keys
Constructor Details
#initialize(repos, required_labels_json_file_path = "", sandbox = false, name = "", color = "", description = "") ⇒ Upsert
Returns a new instance of Upsert.
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/neetob/cli/github/labels/upsert.rb', line 16 def initialize(repos, required_labels_json_file_path = "", sandbox = false, name = "", color = "", description = "") super() @repos = repos @required_labels_json_file_path = required_labels_json_file_path @sandbox = sandbox @name = name @color = color @description = description end |
Instance Attribute Details
#color ⇒ Object
Returns the value of attribute color.
14 15 16 |
# File 'lib/neetob/cli/github/labels/upsert.rb', line 14 def color @color end |
#description ⇒ Object
Returns the value of attribute description.
14 15 16 |
# File 'lib/neetob/cli/github/labels/upsert.rb', line 14 def description @description end |
#name ⇒ Object
Returns the value of attribute name.
14 15 16 |
# File 'lib/neetob/cli/github/labels/upsert.rb', line 14 def name @name end |
#repos ⇒ Object
Returns the value of attribute repos.
14 15 16 |
# File 'lib/neetob/cli/github/labels/upsert.rb', line 14 def repos @repos end |
#required_labels_json_file_path ⇒ Object
Returns the value of attribute required_labels_json_file_path.
14 15 16 |
# File 'lib/neetob/cli/github/labels/upsert.rb', line 14 def required_labels_json_file_path @required_labels_json_file_path end |
#sandbox ⇒ Object
Returns the value of attribute sandbox.
14 15 16 |
# File 'lib/neetob/cli/github/labels/upsert.rb', line 14 def sandbox @sandbox end |
Instance Method Details
#run ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/neetob/cli/github/labels/upsert.rb', line 27 def run matching_repos = find_all_matching_apps_or_repos(repos, :github, sandbox) inform_about_default_labels_file matching_repos.each do |repo| ui.info("\nWorking on #{repo} repo\n") begin required_labels = get_required_labels required_labels.each do |label| create_or_update_label(repo, label) sleep(1) end rescue StandardError => e ExceptionHandler.new(e).process end end end |