Class: InchCI::Worker::Project::UpdateHook

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

Overview

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

Constant Summary collapse

REBUILD_URL_PATTERN =
/https*\:\/\/inch-ci\.org\/rebuild/

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.enqueue(uid, user_access_token) ⇒ void

This method returns an undefined value.

Parameters:

  • uid (String)

15
16
17
# File 'lib/inch_ci/worker/project/update_hook.rb', line 15

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

Instance Method Details

#perform(uid, user_access_token) ⇒ 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

    used to directly update a project


21
22
23
24
25
26
27
28
29
# File 'lib/inch_ci/worker/project/update_hook.rb', line 21

def perform(uid, user_access_token)
  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_access_token)
  end
end