Class: Giblish::GitRepoIndexBuilder

Inherits:
BasicIndexBuilder show all
Defined in:
lib/giblish/buildindex.rb

Overview

Builds an index of the generated documents and includes some git metadata from the repository

Instance Method Summary collapse

Methods inherited from BasicIndexBuilder

#source

Constructor Details

#initialize(processed_docs, converter, path_manager, deployment_info, manage_docid, git_repo_root) ⇒ GitRepoIndexBuilder

Returns a new instance of GitRepoIndexBuilder.


312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
# File 'lib/giblish/buildindex.rb', line 312

def initialize(processed_docs, converter, path_manager, deployment_info, manage_docid, git_repo_root)
  super processed_docs, converter, path_manager, deployment_info, manage_docid

  # no repo root given...
  return unless git_repo_root

  begin
    # Make sure that we can "talk" to git if user feeds us
    # a git repo root
    @git_repo = Git.open(git_repo_root)
    @git_repo_root = git_repo_root
  rescue StandardError => e
    Giblog.logger.error { "No git repo! exception: #{e.message}" }
  end
end