Class: Spoom::Cli::Main
- Inherits:
-
Thor
- Object
- Thor
- Spoom::Cli::Main
- Extended by:
- T::Sig
- Includes:
- Helper
- Defined in:
- lib/spoom/cli.rb
Constant Summary
Constants included from Helper
Class Method Summary collapse
-
.exit_on_failure? ⇒ Boolean
Utils.
Instance Method Summary collapse
Methods included from Helper
#blue, #color?, #colorize, #exec_path, #gray, #green, #highlight, #in_sorbet_project!, #in_sorbet_project?, #red, #say, #say_error, #sorbet_config, #sorbet_config_file, #yellow
Class Method Details
.exit_on_failure? ⇒ Boolean
Utils
74 75 76 |
# File 'lib/spoom/cli.rb', line 74 def self.exit_on_failure? true end |
Instance Method Details
#__print_version ⇒ Object
68 69 70 |
# File 'lib/spoom/cli.rb', line 68 def __print_version puts "Spoom v#{Spoom::VERSION}" end |
#files ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# 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 [: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 [:tree] tree = FileTree.new(files, strip_prefix: path) tree.print(colors: [:color], indent_level: 0) else puts files end end |