From 60a94ef2524662cf0e544426383f33f5445eae64 Mon Sep 17 00:00:00 2001 From: kitchen-porter Date: Wed, 6 Nov 2024 01:04:34 +0000 Subject: [PATCH] Cookstyle 7.32.8 Fixes Issues found and resolved with: libraries/sql/_connection.rb - 77:11 refactor: Chef/Style/UnnecessaryPlatformCaseStatement - Use the platform? and platform_family? helpers instead of a case statement that only includes a single when statement. https://docs.chef.io/workstation/cookstyle/chef_style_unnecessaryplatformcasestatement Signed-off-by: kitchen-porter --- CHANGELOG.md | 2 ++ libraries/sql/_connection.rb | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8aed9fb9..5e5b02d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ This file is used to list changes made in the last 3 major versions of the postg ## Unreleased +- resolved cookstyle error: `libraries/sql/_connection.rb:77:11` refactor: `Chef/Style/UnnecessaryPlatformCaseStatement` + ## 12.0.0 - *2024-11-05* - Remove support for Fedora diff --git a/libraries/sql/_connection.rb b/libraries/sql/_connection.rb index aa83ccce..2ca4e5cb 100644 --- a/libraries/sql/_connection.rb +++ b/libraries/sql/_connection.rb @@ -74,8 +74,7 @@ def install_pg_gem 'libpq5' end - case node['platform_family'] - when 'rhel' + if platform_family?('rhel') case node['platform_version'].to_i when 7 declare_resource(:package, 'epel-release') { compile_time(true) }