dev-ruby/facter: enable ruby34, ruby40

Signed-off-by: Alfred Wingate <parona@protonmail.com>
Part-of: https://codeberg.org/gentoo/gentoo/pulls/1527
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Alfred Wingate
2026-07-24 14:31:12 +03:00
committed by Sam James
parent 2c05ec7d90
commit 78b6791ca2
2 changed files with 47 additions and 1 deletions

View File

@@ -2,7 +2,7 @@
# Distributed under the terms of the GNU General Public License v2
EAPI=8
USE_RUBY="ruby32 ruby33"
USE_RUBY="ruby32 ruby33 ruby34 ruby40"
RUBY_FAKEGEM_GEMSPEC="facter.gemspec"
RUBY_FAKEGEM_RECIPE_TEST="rspec3"
RUBY_FAKEGEM_RECIPE_DOC="yard"
@@ -33,6 +33,7 @@ ruby_add_bdepend "test? ( dev-ruby/simplecov dev-ruby/timecop dev-ruby/webmock )
PATCHES=(
"${FILESDIR}"/facter-4.7.0-gentoo-thor-gemspec.patch
"${FILESDIR}"/facter-4.10.0-gentoo-os-release.patch
"${FILESDIR}"/facter-4.10.0-ruby34.patch
)
src_unpack() {

View File

@@ -0,0 +1,45 @@
--- a/spec/facter/facter_spec.rb
+++ b/spec/facter/facter_spec.rb
@@ -598,7 +598,12 @@ describe Facter do
context 'when exception and message are hashes' do
let(:message) { { 'a': 1 } }
let(:exception) { { 'b': 2 } }
- let(:expected_message) { '{:a=>1}' }
+ # https://bugs.ruby-lang.org/issues/20433
+ if RUBY_VERSION >= '3.4'
+ let(:expected_message) { '{a: 1}' }
+ else
+ let(:expected_message) { '{:a=>1}' }
+ end
it_behaves_like 'when exception param is not an exception'
end
@@ -682,7 +687,12 @@ describe Facter do
context 'when exception and message are hashes' do
let(:message) { { 'a': 1 } }
let(:exception) { { 'b': 2 } }
- let(:expected_message) { '{:a=>1}' }
+ # https://bugs.ruby-lang.org/issues/20433
+ if RUBY_VERSION >= '3.4'
+ let(:expected_message) { '{a: 1}' }
+ else
+ let(:expected_message) { '{:a=>1}' }
+ end
it_behaves_like 'when exception param is not an exception'
end
@@ -808,7 +818,12 @@ describe Facter do
end
it 'when message is a hash' do
- expect(logger).to receive(:warn).with('{:warn=>"message"}')
+ # https://bugs.ruby-lang.org/issues/20433
+ if RUBY_VERSION >= '3.4'
+ expect(logger).to receive(:warn).with('{warn: "message"}')
+ else
+ expect(logger).to receive(:warn).with('{:warn=>"message"}')
+ end
Facter.warn({ warn: 'message' })
end