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
12
|
# 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)
super()
end
|
Instance Method Details
#match?(format) ⇒ Boolean
14
15
16
|
# File 'lib/spandx/cli/printers/table.rb', line 14
def match?(format)
format.to_sym == :table
end
|
27
28
29
30
31
|
# File 'lib/spandx/cli/printers/table.rb', line 27
def (io)
@spinner.stop
@spinner.reset
io.puts(to_table(@dependencies.map(&:to_a)))
end
|
18
19
20
21
|
# File 'lib/spandx/cli/printers/table.rb', line 18
def (_io)
@spinner.auto_spin
@dependencies = SortedSet.new
end
|
#print_line(dependency, _io) ⇒ Object
23
24
25
|
# File 'lib/spandx/cli/printers/table.rb', line 23
def print_line(dependency, _io)
@dependencies << dependency
end
|