summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/spandx/cli/commands/pull.rb2
-rw-r--r--lib/spandx/cli/printers/table.rb7
2 files changed, 5 insertions, 4 deletions
diff --git a/lib/spandx/cli/commands/pull.rb b/lib/spandx/cli/commands/pull.rb
index ebf4618..bcff1b0 100644
--- a/lib/spandx/cli/commands/pull.rb
+++ b/lib/spandx/cli/commands/pull.rb
@@ -37,7 +37,7 @@ module Spandx
end
def with_spinner(message, output:)
- spinner = TTY::Spinner.new("[:spinner] #{message}", clear: false, output: output)
+ spinner = TTY::Spinner.new("[:spinner] #{message}", output: output)
spinner.auto_spin
yield
spinner.success('(done)')
diff --git a/lib/spandx/cli/printers/table.rb b/lib/spandx/cli/printers/table.rb
index 931b739..e9672e8 100644
--- a/lib/spandx/cli/printers/table.rb
+++ b/lib/spandx/cli/printers/table.rb
@@ -6,8 +6,9 @@ module Spandx
class Table < Printer
HEADINGS = ['Name', 'Version', 'Licenses', 'Location'].freeze
- def initialize
- @spinner = TTY::Spinner.new(output: $stderr)
+ def initialize(output: $stderr)
+ @spinner = TTY::Spinner.new('[:spinner] Scanning...', output: output, clear: true, format: :dots)
+ @spinner.auto_spin
end
def match?(format)
@@ -16,7 +17,6 @@ module Spandx
def print_header(_io)
@dependencies = SortedSet.new
- @spinner.auto_spin
end
def print_line(dependency, _io)
@@ -25,6 +25,7 @@ module Spandx
def print_footer(io)
@spinner.stop
+ @spinner.reset
io.puts(to_table(@dependencies.map(&:to_a)))
end