From 6b0587fce562733999348ff68940b2d7ac01715c Mon Sep 17 00:00:00 2001 From: Mark VanderVoord Date: Thu, 1 Aug 2024 12:12:08 -0400 Subject: [PATCH] Fixes to latest stylistic warnings. --- lib/cmock.rb | 0 lib/cmock_version.rb | 17 ++++++++--------- 2 files changed, 8 insertions(+), 9 deletions(-) mode change 100644 => 100755 lib/cmock.rb diff --git a/lib/cmock.rb b/lib/cmock.rb old mode 100644 new mode 100755 diff --git a/lib/cmock_version.rb b/lib/cmock_version.rb index dc77c23..d4fa78f 100644 --- a/lib/cmock_version.rb +++ b/lib/cmock_version.rb @@ -1,23 +1,22 @@ - module CMockVersion # Where is the header file from here? - path = File.expand_path( File.join(File.dirname(__FILE__),"..","src","cmock.h") ) + path = File.expand_path(File.join(File.dirname(__FILE__), '..', 'src', 'cmock.h')) # Actually look up the version in the header file - a = [0,0,0] + a = [0, 0, 0] begin File.readlines(path).each do |line| - ["VERSION_MAJOR", "VERSION_MINOR", "VERSION_BUILD"].each_with_index do |field, i| + %w[VERSION_MAJOR VERSION_MINOR VERSION_BUILD].each_with_index do |field, i| m = line.match(/CMOCK_#{field}\s+(\d+)/) - a[i] = m[1] unless (m.nil?) + a[i] = m[1] unless m.nil? end end - rescue - abort("Can't find my header file.") + rescue StandardError + abort('Can\'t find my header file.') end # splat it to return the final value - CMOCK_VERSION = "#{a.join(".")}" + CMOCK_VERSION = a.join('.') - GEM = "0.32.0" + GEM = CMOCK_VERSION end