class Avmtrf1::Tools::Runner::Git::Gitlab::CommitLink

def commit_banner(commit)

def commit_banner(commit)
  separator
  infov 'Source', commit.source
  infov 'Commit ID', commit.id
  infov 'Web URL', commit.web_url
end

def commit_output(commit)

Returns:
  • (String) -
def commit_output(commit)
  return commit.textile_link(object_type) if parsed.textile?
  return commit.markdown_link(object_type) if parsed.markdown?
  commit.web_url(object_type)
end

def commits_uncached

def commits_uncached
  parsed.revisions.if_present(['HEAD'])
    .map { |source| ::Avmtrf1::Gitlab::Commit.new(repository, git_repo, source) }
end

def git_repo

def git_repo
  runner_context.call(:git_repo)
end

def object_type

def object_type
  parsed.tree? ? 'tree' : 'commit'
end

def output_content

def output_content
  commits.map { |c| commit_output(c) + "\n" }.join # rubocop:disable Style/StringConcatenation
end

def repository_banner

def repository_banner
  separator
  infov 'Repository', repository.path
end

def repository_uncached

def repository_uncached
  git_repo.remotes.lazy
    .map { |r| ::Avmtrf1::Gitlab::Repository.by_uri(r.url) }
    .find(&:present?) || raise('Gitlab remote not found')
end

def run

def run
  repository_banner
  commits.each { |c| commit_banner(c) }
  run_output
end

def separator

def separator
  puts '-' * 40
end