Class: WindClutter::CLI::Commands::Analysis::Traverse

Inherits:
Dry::CLI::Command
  • Object
show all
Includes:
WindClutter, Util
Defined in:
lib/windclutter/cli/commands/analysis.rb

Overview

Perform full traversal analysis

Constant Summary

Constants included from WindClutter

VERSION

Instance Method Summary collapse

Instance Method Details

#call(suffix:, **options) ⇒ Object



49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/windclutter/cli/commands/analysis.rb', line 49

def call(suffix:, **options)
  full = options.fetch(:full)
  suffixes = suffix.split(',')
  collect_count = full ? 0 : options.fetch(:collect).to_i
  puts "Analysing #{suffix}...".yellow

  total, scanned, file_count = Analyser.traverse(suffixes, collect_count)
  puts "Traversed #{file_count} #{suffix} file(s)... 🎉".green
  ap scanned
  return unless collect_count.positive? && (total - collect_count).positive?

  puts "...and #{total - collect_count} more".yellow
end