Class: Neetob::CLI::Github::Labels::DeleteAll

Inherits:
Base
  • Object
show all
Defined in:
lib/neetob/cli/github/labels/delete_all.rb

Constant Summary

Constants inherited from Base

Base::NEETO_APPS_LIST_LINK

Instance Attribute Summary collapse

Attributes inherited from Base

#client

Attributes inherited from Base

#ui

Instance Method Summary collapse

Methods included from Utils

#camel_case_to_slug, #is_upper?, #symbolize_keys

Constructor Details

#initialize(repos, sandbox = false) ⇒ DeleteAll

Returns a new instance of DeleteAll.



14
15
16
17
18
# File 'lib/neetob/cli/github/labels/delete_all.rb', line 14

def initialize(repos, sandbox = false)
  super()
  @repos = repos
  @sandbox = sandbox
end

Instance Attribute Details

#reposObject

Returns the value of attribute repos.



12
13
14
# File 'lib/neetob/cli/github/labels/delete_all.rb', line 12

def repos
  @repos
end

#sandboxObject

Returns the value of attribute sandbox.



12
13
14
# File 'lib/neetob/cli/github/labels/delete_all.rb', line 12

def sandbox
  @sandbox
end

Instance Method Details

#runObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/neetob/cli/github/labels/delete_all.rb', line 20

def run
  matching_repos = find_all_matching_apps_or_repos(repos, :github, sandbox)
  matching_repos.each do |repo|
    ui.info("\n Working on #{repo} repo \n")
    begin
      labels = client.labels(repo)
      labels.each do |label|
        delete_label(repo, label)
      end
    rescue StandardError => e
      ExceptionHandler.new(e).process
    end
  end
end