From 1525225f3fda6dab9dcb183abbdf7dd65a2a1366 Mon Sep 17 00:00:00 2001 From: Chedli Bourguiba Date: Wed, 1 Nov 2023 11:26:57 +0100 Subject: [PATCH] Exit with status code 1 when consts are found --- collector.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/collector.rb b/collector.rb index 394ecc8..659ccb4 100644 --- a/collector.rb +++ b/collector.rb @@ -66,6 +66,10 @@ def validate_const(namespaced_const_string) runner = Class.new(Parser::Runner) do + class << self + attr_accessor :_has_errors + end + def runner_name "dudu" end @@ -81,7 +85,9 @@ def show(collection) return if collection.empty? puts collection.each { |pair| puts pair.join("\t") } + self.class._has_errors = true end end -runner.go(ARGV) \ No newline at end of file +runner.go(ARGV) +exit 1 if runner._has_errors