Skip to content

Commit

Permalink
Version fix
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mkarlesky committed Apr 21, 2024
1 parent b6947e3 commit 9b090f1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/ceedling/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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

0 comments on commit 9b090f1

Please sign in to comment.