class Spoom::Cli::Main

Public Class Methods

exit_on_failure?() click to toggle source

Utils

# File lib/spoom/cli.rb, line 74
def self.exit_on_failure?
  true
end

Public Instance Methods

__print_version() click to toggle source
# File lib/spoom/cli.rb, line 68
def __print_version
  puts "Spoom v#{Spoom::VERSION}"
end
files() click to toggle source
# File lib/spoom/cli.rb, line 43
def files
  in_sorbet_project!

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

  unless options[:rbi]
    files = files.reject { |file| file.end_with?(".rbi") }
  end

  if files.empty?
    say_error("No file matching `#{sorbet_config_file}`")
    exit(1)
  end

  if options[:tree]
    tree = FileTree.new(files, strip_prefix: path)
    tree.print(colors: options[:color], indent_level: 0)
  else
    puts files
  end
end