Class: GemWhy::Formatters::DirectFormatter
- Inherits:
-
BaseFormatter
- Object
- BaseFormatter
- GemWhy::Formatters::DirectFormatter
- Defined in:
- lib/gem_why/formatters/direct_formatter.rb
Overview
Formats direct dependencies output
Instance Attribute Summary
Attributes inherited from BaseFormatter
Instance Method Summary collapse
-
#format(gem_name, dependents) ⇒ void
Formats and displays direct dependencies.
Methods inherited from BaseFormatter
Constructor Details
This class inherits a constructor from GemWhy::Formatters::BaseFormatter
Instance Method Details
#format(gem_name, dependents) ⇒ void
This method returns an undefined value.
Formats and displays direct dependencies
13 14 15 16 17 18 19 |
# File 'lib/gem_why/formatters/direct_formatter.rb', line 13 def format(gem_name, dependents) return say "No gems depend on #{colorize(gem_name, :yellow)}" if dependents.empty? say "Gems that depend on #{colorize(gem_name, :cyan)}:\n\n" print_direct_dependents(dependents, gem_name) say "\n#{colorize("Total:", :green)} #{dependents.size} gem(s)" end |