Class: Spandx::Cli::Printers::Table
Constant Summary
collapse
- HEADINGS =
['Name', 'Version', 'Licenses', 'Location'].freeze
Instance Method Summary
collapse
for
#all, #each, #inherited, #registry
Constructor Details
#initialize(output: $stderr) ⇒ Table
Returns a new instance of Table.
9
10
11
|
# File 'lib/spandx/cli/printers/table.rb', line 9
def initialize(output: $stderr)
@spinner = TTY::Spinner.new('[:spinner] Scanning...', output: output, clear: true, format: :dots)
end
|
Instance Method Details
#match?(format) ⇒ Boolean
13
14
15
|
# File 'lib/spandx/cli/printers/table.rb', line 13
def match?(format)
format.to_sym == :table
end
|
26
27
28
29
30
|
# File 'lib/spandx/cli/printers/table.rb', line 26
def (io)
@spinner.stop
@spinner.reset
io.puts(to_table(@dependencies.map(&:to_a)))
end
|
17
18
19
20
|
# File 'lib/spandx/cli/printers/table.rb', line 17
def (_io)
@spinner.auto_spin
@dependencies = SortedSet.new
end
|
#print_line(dependency, _io) ⇒ Object
22
23
24
|
# File 'lib/spandx/cli/printers/table.rb', line 22
def print_line(dependency, _io)
@dependencies << dependency
end
|