Class: Giblish::GitRepoConverter

Inherits:
FileTreeConverter show all
Defined in:
lib/giblish/core.rb

Instance Attribute Summary

Attributes inherited from FileTreeConverter

#converter

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ GitRepoConverter

Returns a new instance of GitRepoConverter.



250
251
252
253
254
255
256
257
258
259
# File 'lib/giblish/core.rb', line 250

def initialize(options)
  super(options)
  # cache the top of the tree since we need to redefine the
  # paths per branch/tag later on.
  @master_paths = @paths.dup
  @git_repo_root = options[:gitRepoRoot]
  @git_repo = init_git_repo @git_repo_root, options[:localRepoOnly]
  @user_branches = select_user_branches(options[:gitBranchRegexp])
  @user_tags = select_user_tags(options[:gitTagRegexp])
end

Instance Method Details

#convertObject

Render the docs from each branch/tag and add info to the summary page



263
264
265
266
267
268
269
270
271
272
273
274
275
# File 'lib/giblish/core.rb', line 263

def convert
  (@user_branches + @user_tags).each do |co|
    convert_one_checkout co
  end

  # Render the summary page
  index_builder = GitSummaryIndexBuilder.new @git_repo,
                                             @user_branches,
                                             @user_tags
  @converter.convert_str index_builder.source, @master_paths.dst_root_abs, "index"
  # clean up
  GC.start
end