Class: Veye::Github::Sync

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

Overview

Sync class is responsible for updating info on VersionEye

Class Method Summary collapse

Methods inherited from BaseExecutor

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

Methods included from FormatHelpers

#format_exists?, #formats_attached?, #supported_format?

Class Method Details

.import_all(api_key, options) ⇒ Object



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

def self.import_all(api_key, options)
  response = Veye::API::Github.import_all(api_key, options[:force])
  catch_request_error(response, 'Can not import repositories from Github')
  show_result(response)
end

.show_result(response) ⇒ Object



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

def self.show_result(response)
  if response.data['changed']
    printf "Imported. #{response.data['msg']}\n".color(:green)
  else
    printf("%s - %s\n",
           'No changes.'.color(:red),
           'Use `force` flag if you want to reload everything.')
  end
end