class GitCompound::Worker::PrettyPrint

Worker that prints dependency tree

Public Instance Methods

visit_component(component) click to toggle source
# File lib/git_compound/worker/pretty_print.rb, line 6
def visit_component(component)
  pretty_print(component, " `#{component.name}` component, #{component.version}")
end
visit_manifest(manifest) click to toggle source
# File lib/git_compound/worker/pretty_print.rb, line 10
def visit_manifest(manifest)
  details = []
  details << "Component: #{manifest.name}" unless manifest.name.empty?
  details << "Maintainer: #{manifest.maintainer.join(', ')}" unless
    manifest.maintainer.empty?
  details << 'Dependencies:' unless manifest.components.empty?

  pretty_print(manifest, *details)
end

Private Instance Methods

pretty_print(element, *messages) click to toggle source
# File lib/git_compound/worker/pretty_print.rb, line 22
def pretty_print(element, *messages)
  messages.each do |message|
    Logger.inline '    ' * element.ancestors.count
    Logger.info message
  end
end