From 9b090f195a06304ac07635273ad757212ba9f117 Mon Sep 17 00:00:00 2001 From: Mike Karlesky Date: Sat, 20 Apr 2024 22:31:23 -0400 Subject: [PATCH] Version fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Can’t use Ceedling’s custom exception type because the require path is impractical between running version.rb as a script for release builds and using it internally for CLI version commands. --- lib/ceedling/version.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/ceedling/version.rb b/lib/ceedling/version.rb index 7c33769a..ec740351 100644 --- a/lib/ceedling/version.rb +++ b/lib/ceedling/version.rb @@ -5,7 +5,10 @@ # SPDX-License-Identifier: MIT # ========================================================================= -require 'ceedling/exceptions' +# +# version.rb is run: +# - As a script to produce a Ceedling version number to $stdout in gem release builds +# - As a module of version constants consumed by Ceedling's command line version output module Ceedling module Version @@ -31,7 +34,7 @@ module Version end end rescue - raise CeedlingException.new( "Could not collect version information for vendor component: #{filename}" ) + raise( "Could not collect version information for vendor component: #{filename}" ) end # Splat it to crete the final constant @@ -41,6 +44,7 @@ module Version GEM = "0.3.2" CEEDLING = GEM - puts CEEDLING if __FILE__ == $0 + # If run as a script, end with printing Ceedling’s version to $stdout + puts CEEDLING if (__FILE__ == $0) end end