From d5e938e4b1ffc64acc70c7cf9b7ac6591f806c0b Mon Sep 17 00:00:00 2001 From: Mark VanderVoord Date: Wed, 23 Oct 2024 16:01:48 -0400 Subject: [PATCH] - refactor to match coding standards. - test against Ruby 3.3 also. --- .github/workflows/main.yml | 2 +- lib/cmock_config.rb | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a9bf8b7..9c89b14 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby: ['3.0', '3.1', '3.2'] + ruby: ['3.0', '3.1', '3.2', '3.3'] steps: # Install Multilib - name: Install Multilib diff --git a/lib/cmock_config.rb b/lib/cmock_config.rb index 1b3acfd..8bb6b5a 100644 --- a/lib/cmock_config.rb +++ b/lib/cmock_config.rb @@ -81,11 +81,9 @@ class CMockConfig require 'pathname' includes1 = options[:includes_c_post_header] || [] includes2 = options[:unity_helper_path].map do |path| - begin - Pathname(File.expand_path(path)).relative_path_from(Pathname(File.expand_path(options[:mock_path]))).to_s - rescue - path - end + Pathname(File.expand_path(path)).relative_path_from(Pathname(File.expand_path(options[:mock_path]))).to_s + rescue StandardError + path end options[:includes_c_post_header] = (includes1 + includes2).uniq end