2018-11-07 11:44:21 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-06-15 11:08:20 -04:00
|
|
|
class Import::GithubishProviderRepoEntity < Import::BaseProviderRepoEntity
|
2018-11-07 11:44:21 -05:00
|
|
|
include ImportHelper
|
|
|
|
|
2020-06-15 11:08:20 -04:00
|
|
|
expose :sanitized_name, override: true do |provider_repo|
|
2018-11-07 11:44:21 -05:00
|
|
|
sanitize_project_name(provider_repo[:name])
|
|
|
|
end
|
|
|
|
|
2020-06-15 11:08:20 -04:00
|
|
|
expose :provider_link, override: true do |provider_repo, options|
|
2018-11-07 11:44:21 -05:00
|
|
|
provider_project_link_url(options[:provider_url], provider_repo[:full_name])
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def owner_name(provider_repo, provider)
|
|
|
|
provider_repo.dig(:owner, :login) if provider == :github
|
|
|
|
end
|
|
|
|
end
|