lib/coveralls/output.rb in coveralls_reborn-0.13.1 vs lib/coveralls/output.rb in coveralls_reborn-0.13.2
- old
+ new
@@ -63,17 +63,14 @@
# # => "\e[36mHello World\e[0m"
#
# Returns the formatted string.
def format(string, options = {})
unless no_color?
- begin
- require 'term/ansicolor'
- options[:color]&.split(/\s/)&.reverse_each do |color|
- next unless Term::ANSIColor.respond_to?(color.to_sym)
+ require 'term/ansicolor'
+ options[:color]&.split(/\s/)&.reverse_each do |color|
+ next unless Term::ANSIColor.respond_to?(color.to_sym)
- string = Term::ANSIColor.send(color.to_sym, string)
- end
- rescue LoadError # rubocop:disable Lint/HandleExceptions
+ string = Term::ANSIColor.send(color.to_sym, string)
end
end
string
end