Class: Veye::Github::Delete

Inherits:
BaseExecutor show all
Defined in:
lib/veye/github/delete.rb

Overview

Delete class include methods to cleanup projects imported from Github

Class Method Summary collapse

Methods inherited from BaseExecutor

catch_request_error, filter_dependencies, get_formatter, show_bulk_dependencies, show_dependencies, show_message, show_results, valid_response?

Methods included from FormatHelpers

#format_exists?, #formats_attached?, #supported_format?

Class Method Details

.delete_repo(api_key, repo_name, options) ⇒ Object



7
8
9
10
11
12
# File 'lib/veye/github/delete.rb', line 7

def self.delete_repo(api_key, repo_name, options)
  response = Veye::API::Github.delete_repo(
    api_key, repo_name, options[:branch]
  )
  show_result(response)
end

.show_result(response) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/veye/github/delete.rb', line 14

def self.show_result(response)
  if response.success
    printf "Deleted\n".color(:green)
  else
    printf("Cant delete - %s\n%s\n",
           response.message.color(:red),
           response.data['error'])
  end
end