diff --git a/rubygem-activerecord-5.2.3-Update-for-Time-inspect.patch b/rubygem-activerecord-5.2.3-Update-for-Time-inspect.patch new file mode 100644 index 0000000..675676c --- /dev/null +++ b/rubygem-activerecord-5.2.3-Update-for-Time-inspect.patch @@ -0,0 +1,24 @@ +From dbb9833ef7f133afa7d2872ec4554245a7572141 Mon Sep 17 00:00:00 2001 +From: Nobuyoshi Nakada +Date: Sat, 21 Sep 2019 16:57:24 +0900 +Subject: [PATCH] Update for `Time#inspect` + +Since ruby/ruby@5208c431be, `Time#inspect` is separated from +`Time#to_s`, and the former may contain the fraction part now. +--- + activerecord/test/cases/core_test.rb | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/activerecord/test/cases/core_test.rb b/activerecord/test/cases/core_test.rb +index 36e3d543cd34..de6f4d28aa03 100644 +--- a/activerecord/test/cases/core_test.rb ++++ b/activerecord/test/cases/core_test.rb +@@ -74,7 +74,7 @@ def test_pretty_print_persisted + title: "The First Topic", + author_name: "David", + author_email_address: "david@loudthinking.com", +- written_on: 2003-07-16 14:28:11 UTC, ++ written_on: 2003-07-16 14:28:11(?:\.2233)? UTC, + bonus_time: 2000-01-01 14:28:00 UTC, + last_read: Thu, 15 Apr 2004, + content: "Have a nice day", diff --git a/rubygem-activerecord.spec b/rubygem-activerecord.spec index b1acae4..1129432 100644 --- a/rubygem-activerecord.spec +++ b/rubygem-activerecord.spec @@ -4,7 +4,7 @@ Name: rubygem-%{gem_name} Epoch: 1 Version: 5.2.3 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Object-relational mapper framework (part of Rails) License: MIT URL: http://rubyonrails.org @@ -13,6 +13,9 @@ Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem # cd rails/activerecord/ # git checkout v5.2.3 && tar czvf activerecord-5.2.3-tests.tgz test/ Source1: activerecord-%{version}-tests.tgz +# Fix Ruby 2.7 compatibility. +# https://github.com/rails/rails/pull/37262 +Patch0: rubygem-activerecord-5.2.3-Update-for-Time-inspect.patch # Database dump/load reuires the executable. Suggests: %{_bindir}/sqlite3 @@ -43,7 +46,11 @@ BuildArch: noarch Documentation for %{name}. %prep -%setup -q -n %{gem_name}-%{version} +%setup -q -n %{gem_name}-%{version} -b 1 + +pushd %{_builddir} +%patch0 -p2 +popd %build gem build ../%{gem_name}-%{version}.gemspec @@ -58,9 +65,8 @@ cp -a .%{gem_dir}/* \ %check pushd .%{gem_instdir} -tar xzvf %{SOURCE1} - -cat %{PATCH1} | patch -p2 -F 0 +# Move the tests into place. +cp -a %{_builddir}/test test # Tests are broken on Fedora # https://github.com/rails/rails/pull/34436 @@ -98,6 +104,10 @@ popd %{gem_instdir}/examples %changelog +* Fri Apr 17 2020 Vít Ondruch - 1:5.2.3-4 +- Fix Ruby 2.7 test errors. + Resovles: rhbz#1799986 + * Thu Jan 30 2020 Fedora Release Engineering - 1:5.2.3-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild