From 6b00408efe83d65d595b1f1b22c9c3afbc683ac5 Mon Sep 17 00:00:00 2001 From: Mamoru TASAKA Date: Dec 07 2022 08:14:47 +0000 Subject: Apply upstreamed patch for ruby3.2 File.exists? removal --- diff --git a/rubygem-hocon-1.3.1-replace-File_exists.patch b/rubygem-hocon-1.3.1-replace-File_exists.patch new file mode 100644 index 0000000..3df5e12 --- /dev/null +++ b/rubygem-hocon-1.3.1-replace-File_exists.patch @@ -0,0 +1,26 @@ +From 05139ff84f97849c7b1e5644181e4197538ebbb8 Mon Sep 17 00:00:00 2001 +From: Mamoru TASAKA +Date: Tue, 6 Dec 2022 11:49:58 +0900 +Subject: [PATCH] (maint) replace File.exists? with File.exist for ruby3.2 + +File.exists? is already deprecated since ruby 2.1 and will be removed with +ruby 3.2. Replace this with File.exist? . + +Fixes #126 . +--- + lib/hocon/impl/parseable.rb | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/hocon/impl/parseable.rb b/lib/hocon/impl/parseable.rb +index 30c94e4..78e8868 100644 +--- a/lib/hocon/impl/parseable.rb ++++ b/lib/hocon/impl/parseable.rb +@@ -442,7 +442,7 @@ def relative_to(filename) + end + if sibling.nil? + nil +- elsif File.exists?(sibling) ++ elsif File.exist?(sibling) + self.class.trace("#{sibling} exists, so loading it as a file") + Hocon::Impl::Parseable.new_file(sibling, options.set_origin_description(nil)) + else diff --git a/rubygem-hocon.spec b/rubygem-hocon.spec index 7cbbd04..6b4af01 100644 --- a/rubygem-hocon.spec +++ b/rubygem-hocon.spec @@ -9,7 +9,7 @@ Name: rubygem-%{gem_name} Version: 1.3.1 -Release: 5%{?dist} +Release: 6%{?dist} Summary: HOCON Config Library License: ASL 2.0 URL: https://github.com/puppetlabs/ruby-hocon @@ -23,6 +23,9 @@ Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem # However the rspec files were then removed again for a bizare reason. # https://tickets.puppetlabs.com/browse/PA-2942 Source1: https://github.com/puppetlabs/ruby-hocon/archive/%{version}/ruby-hocon-%{version}.tar.gz +# https://github.com/puppetlabs/ruby-hocon/pull/127 +# ruby3.2 removes File.exists? deprecated since ruby 2.1 +Patch0: rubygem-hocon-1.3.1-replace-File_exists.patch BuildRequires: ruby(release) BuildRequires: rubygems-devel @@ -49,6 +52,7 @@ Documentation for %{name}. gem unpack %{SOURCE0} %setup -q -D -T -n %{gem_name}-%{version} +%patch0 -p1 gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec sed -i 's/\/usr\/bin\/env ruby/\/usr\/bin\/ruby/' bin/hocon @@ -93,6 +97,9 @@ rspec spec/ %doc %{gem_instdir}/README.md %changelog +* Wed Dec 7 2022 Mamoru TASAKA - 1.3.1-6 +- Apply upstreamed patch for ruby3.2 File.exists? removal + * Sat Jul 23 2022 Fedora Release Engineering - 1.3.1-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild