lib/spoom/printer.rb in spoom-1.1.11 vs lib/spoom/printer.rb in spoom-1.1.12
- old
+ new
@@ -36,19 +36,21 @@
# Print `string` into `out`
sig { params(string: T.nilable(String)).void }
def print(string)
return unless string
+
@out.print(string)
end
# Print `string` colored with `color` into `out`
#
# Does not use colors unless `@colors`.
sig { params(string: T.nilable(String), color: Color).void }
def print_colored(string, *color)
return unless string
+
string = T.unsafe(self).colorize(string, *color)
@out.print(string)
end
# Print a new line into `out`
@@ -59,10 +61,11 @@
# Print `string` with indent and newline
sig { params(string: T.nilable(String)).void }
def printl(string)
return unless string
+
printt
print(string)
printn
end
@@ -74,9 +77,10 @@
# Colorize `string` with color if `@colors`
sig { params(string: String, color: Spoom::Color).returns(String) }
def colorize(string, *color)
return string unless @colors
+
T.unsafe(self).set_color(string, *color)
end
end
end