Class: GitCompound::Worker::PrettyPrint

Inherits:
Worker
  • Object
show all
Defined in:
lib/git_compound/worker/pretty_print.rb

Overview

Worker that prints dependency tree

Instance Method Summary collapse

Methods inherited from Worker

#visit_task

Instance Method Details

#visit_component(component) ⇒ Object



6
7
8
# 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) ⇒ Object



10
11
12
13
14
15
16
17
18
# 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