From 2fffdecb716a18321f8d4cfa55bc5a056e4043d2 Mon Sep 17 00:00:00 2001 From: nikhil2611 Date: Wed, 4 Oct 2023 15:18:38 +0530 Subject: [PATCH 1/3] updated chef dependency for ruby 3.1 Signed-off-by: nikhil2611 --- chef-cli.gemspec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/chef-cli.gemspec b/chef-cli.gemspec index 1a4018f9..edcbde7b 100644 --- a/chef-cli.gemspec +++ b/chef-cli.gemspec @@ -43,7 +43,11 @@ Gem::Specification.new do |gem| gem.add_dependency "mixlib-shellout", ">= 2.0", "< 4.0" gem.add_dependency "ffi-yajl", ">= 1.0", "< 3.0" gem.add_dependency "minitar", "~> 0.6" - gem.add_dependency "chef", ">= 16.0" + if RUBY_VERSION.match?(/3.1/) + gem.add_dependency "chef", "~> 18.0" + elsif + gem.add_dependency "chef", ">= 16.0" # Needed to load cookbooks + end gem.add_dependency "solve", "< 5.0", "> 2.0" gem.add_dependency "addressable", ">= 2.3.5", "< 2.9" gem.add_dependency "cookbook-omnifetch", "~> 0.5" From d8084e3d239af2380eecc14565913ac17ad418d5 Mon Sep 17 00:00:00 2001 From: nikhil2611 Date: Wed, 4 Oct 2023 15:33:42 +0530 Subject: [PATCH 2/3] updated chefstyle Signed-off-by: nikhil2611 --- chef-cli.gemspec | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/chef-cli.gemspec b/chef-cli.gemspec index edcbde7b..08db7be3 100644 --- a/chef-cli.gemspec +++ b/chef-cli.gemspec @@ -45,8 +45,7 @@ Gem::Specification.new do |gem| gem.add_dependency "minitar", "~> 0.6" if RUBY_VERSION.match?(/3.1/) gem.add_dependency "chef", "~> 18.0" - elsif - gem.add_dependency "chef", ">= 16.0" # Needed to load cookbooks + elsif gem.add_dependency "chef", ">= 16.0" end gem.add_dependency "solve", "< 5.0", "> 2.0" gem.add_dependency "addressable", ">= 2.3.5", "< 2.9" From da34cac1b7b769fa7f97b50adbce269d43a69933 Mon Sep 17 00:00:00 2001 From: nikhil2611 Date: Thu, 12 Oct 2023 12:48:26 +0530 Subject: [PATCH 3/3] updated elsif to else condition Signed-off-by: nikhil2611 --- chef-cli.gemspec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chef-cli.gemspec b/chef-cli.gemspec index 08db7be3..08328483 100644 --- a/chef-cli.gemspec +++ b/chef-cli.gemspec @@ -45,7 +45,8 @@ Gem::Specification.new do |gem| gem.add_dependency "minitar", "~> 0.6" if RUBY_VERSION.match?(/3.1/) gem.add_dependency "chef", "~> 18.0" - elsif gem.add_dependency "chef", ">= 16.0" + else + gem.add_dependency "chef", ">= 16.0" end gem.add_dependency "solve", "< 5.0", "> 2.0" gem.add_dependency "addressable", ">= 2.3.5", "< 2.9"