Class: RBS::CLI::Validate::Errors
Relationships & Source Files | |
Inherits: | Object |
Defined in: | lib/rbs/cli/validate.rb |
Class Method Summary
- .new(limit:, exit_error:) ⇒ Errors constructor
Instance Method Summary
- #add(error)
- #finish
- #build_message(error) private
Constructor Details
.new(limit:, exit_error:) ⇒ Errors
# File 'lib/rbs/cli/validate.rb', line 7
def initialize(limit:, exit_error:) @limit = limit @exit_error = exit_error @errors = [] @has_syntax_error = false end
Instance Method Details
#add(error)
[ GitHub ]# File 'lib/rbs/cli/validate.rb', line 14
def add(error) if error.instance_of?(WillSyntaxError) RBS.logger.warn( (error)) @has_syntax_error = true else @errors << error end finish if @limit == 1 end
#build_message(error) (private)
[ GitHub ]# File 'lib/rbs/cli/validate.rb', line 41
def (error) if error.respond_to?(: ) highlight = RBS.logger_output ? RBS.logger_output.tty? : true error. (highlight: highlight) else "#{error.} (#{error.class})" end end