Class: InchCI::Worker::Project::UpdateInfo

Inherits:
Object
  • Object
show all
Includes:
Sidekiq::Worker
Defined in:
lib/inch_ci/worker/project/update_info.rb

Overview

The UpdateInfo worker is responsible for updating a project's meta information, like homepage and documentation URLs.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.enqueue(uid) ⇒ void

This method returns an undefined value.

Parameters:

  • uid (String)

13
14
15
# File 'lib/inch_ci/worker/project/update_info.rb', line 13

def self.enqueue(uid)
  perform_async(uid)
end

Instance Method Details

#perform(uid, github_repo_object = nil) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

  • github_repo_object (defaults to: nil)

    used to directly update a project


19
20
21
22
23
24
25
26
27
# File 'lib/inch_ci/worker/project/update_info.rb', line 19

def perform(uid, github_repo_object = nil)
  project = Store::FindProject.call(uid)
  arr = uid.split(':')
  service_name = arr[0]
  user_repo_name = arr[1]
  if service_name == "github"
    update_via_github(project, user_repo_name, github_repo_object)
  end
end