lib/spoom/cli/helper.rb in spoom-1.1.1 vs lib/spoom/cli/helper.rb in spoom-1.1.2
- old
+ new
@@ -7,12 +7,15 @@
module Spoom
module Cli
module Helper
extend T::Sig
+ extend T::Helpers
include Thor::Shell
+ requires_ancestor Thor
+
# Print `message` on `$stdout`
sig { params(message: String).void }
def say(message)
buffer = StringIO.new
buffer << highlight(message)
@@ -64,11 +67,11 @@
end
# Return the path specified through `--path`
sig { returns(String) }
def exec_path
- T.unsafe(self).options[:path] # TODO: requires_ancestor
+ options[:path]
end
sig { returns(String) }
def sorbet_config_file
Pathname.new("#{exec_path}/#{Spoom::Sorbet::CONFIG_PATH}").cleanpath.to_s
@@ -85,10 +88,10 @@
HIGHLIGHT_COLOR = :blue
# Is the `--color` option true?
sig { returns(T::Boolean) }
def color?
- T.unsafe(self).options[:color] # TODO: requires_ancestor
+ options[:color]
end
sig { params(string: String).returns(String) }
def highlight(string)
return string unless color?