lib/spoom/cli/helper.rb in spoom-1.1.11 vs lib/spoom/cli/helper.rb in spoom-1.1.12
- old
+ new
@@ -58,12 +58,12 @@
sig { void }
def in_sorbet_project!
unless in_sorbet_project?
say_error(
"not in a Sorbet project (`#{sorbet_config_file}` not found)\n\n" \
- "When running spoom from another path than the project's root, " \
- "use `--path PATH` to specify the path to the root."
+ "When running spoom from another path than the project's root, " \
+ "use `--path PATH` to specify the path to the root."
)
Kernel.exit(1)
end
end
@@ -114,13 +114,13 @@
res = StringIO.new
word = StringIO.new
in_ticks = T.let(false, T::Boolean)
string.chars.each do |c|
- if c == '`' && !in_ticks
+ if c == "`" && !in_ticks
in_ticks = true
- elsif c == '`' && in_ticks
+ elsif c == "`" && in_ticks
in_ticks = false
res << colorize(word.string, HIGHLIGHT_COLOR)
word = StringIO.new
elsif in_ticks
word << c
@@ -133,9 +133,10 @@
# Colorize a string if `color?`
sig { params(string: String, color: Color).returns(String) }
def colorize(string, *color)
return string unless color?
+
T.unsafe(self).set_color(string, *color)
end
sig { params(string: String).returns(String) }
def blue(string)