Class: GemWhy::Formatters::DeepFormatter

Inherits:
BaseFormatter show all
Defined in:
lib/gem_why/formatters/deep_formatter.rb

Overview

Formats deep dependency chains output

Instance Attribute Summary

Attributes inherited from BaseFormatter

#command

Instance Method Summary collapse

Methods inherited from BaseFormatter

#initialize

Constructor Details

This class inherits a constructor from GemWhy::Formatters::BaseFormatter

Instance Method Details

#format(gem_name, chains) ⇒ void

This method returns an undefined value.

Formats and displays deep dependency chains

Parameters:

  • gem_name (String)

    the target gem name

  • chains (Array<Array<Hash>>)

    the dependency chains



13
14
15
16
17
18
19
# File 'lib/gem_why/formatters/deep_formatter.rb', line 13

def format(gem_name, chains)
  return say "No gems depend on #{colorize(gem_name, :yellow)}" if chains.empty?

  say "Dependency chains leading to #{colorize(gem_name, :cyan)}:\n\n"
  print_dependency_chains(chains, gem_name)
  print_deep_summary(chains, gem_name)
end