Class: Spoom::Cli::Main

Inherits:
Thor
  • Object
show all
Extended by:
T::Sig
Includes:
Helper
Defined in:
lib/spoom/cli.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Helper

#color?, #colorize, #exec_path, #in_sorbet_project!, #in_sorbet_project?, #say_error, #sorbet_config

Class Method Details

.exit_on_failure?Boolean

Utils

Returns:

  • (Boolean)


63
64
65
# File 'lib/spoom/cli.rb', line 63

def self.exit_on_failure?
  true
end

Instance Method Details

#__print_versionObject



57
58
59
# File 'lib/spoom/cli.rb', line 57

def __print_version
  puts "Spoom v#{Spoom::VERSION}"
end

#filesObject



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/spoom/cli.rb', line 40

def files
  in_sorbet_project!

  path = exec_path
  config = Spoom::Sorbet::Config.parse_file(sorbet_config)
  files = Spoom::Sorbet.srb_files(config, path: path)

  say("Files matching `#{sorbet_config}`:")
  if files.empty?
    say(" NONE")
  else
    tree = FileTree.new(files, strip_prefix: path)
    tree.print(colors: options[:color], indent_level: 2)
  end
end