diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7246a1f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +SOURCES/globalid-0.3.6-tests.tar.gz +SOURCES/globalid-0.3.6.gem diff --git a/.rh-ror50-rubygem-globalid.metadata b/.rh-ror50-rubygem-globalid.metadata new file mode 100644 index 0000000..2554813 --- /dev/null +++ b/.rh-ror50-rubygem-globalid.metadata @@ -0,0 +1,2 @@ +08f56caabae849d6ddace395729b8a14ebd0354a SOURCES/globalid-0.3.6-tests.tar.gz +ef7df2b169c46287623242572fd282eabc80daac SOURCES/globalid-0.3.6.gem diff --git a/README.md b/README.md deleted file mode 100644 index 98f42b4..0000000 --- a/README.md +++ /dev/null @@ -1,4 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/rubygem-globalid-0.3.7-fix-fixnum-bignum-warnings.patch b/SOURCES/rubygem-globalid-0.3.7-fix-fixnum-bignum-warnings.patch new file mode 100644 index 0000000..b87c580 --- /dev/null +++ b/SOURCES/rubygem-globalid-0.3.7-fix-fixnum-bignum-warnings.patch @@ -0,0 +1,49 @@ +From c1ef236d12215484f40baede348a09622e4ac6e7 Mon Sep 17 00:00:00 2001 +From: Jun Aruga +Date: Mon, 13 Feb 2017 23:44:34 +0100 +Subject: [PATCH] Suppress Fixnum/Bignum deprecated warnings for Ruby 2.4.0. + +--- + test/cases/global_id_test.rb | 14 +++++++++----- + 1 file changed, 9 insertions(+), 5 deletions(-) + +diff --git a/test/cases/global_id_test.rb b/test/cases/global_id_test.rb +index 1ccde10..d80a8e5 100644 +--- a/test/cases/global_id_test.rb ++++ b/test/cases/global_id_test.rb +@@ -93,8 +93,10 @@ class GlobalIDCreationTest < ActiveSupport::TestCase + end + + test 'find with multiple class' do +- assert_equal Person.find(@person_gid.model_id), @person_gid.find(only: [Fixnum, Person]) +- assert_equal Person.find(@person_uuid_gid.model_id), @person_uuid_gid.find(only: [Fixnum, Person]) ++ assert_equal Person.find(@person_gid.model_id), ++ @person_gid.find(only: [0.class, Person]) ++ assert_equal Person.find(@person_uuid_gid.model_id), ++ @person_uuid_gid.find(only: [0.class, Person]) + assert_equal PersonModel.find(@person_model_gid.model_id), + @person_model_gid.find(only: [Float, PersonModel]) + assert_equal Person::Child.find(@person_namespaced_gid.model_id), +@@ -102,8 +104,8 @@ class GlobalIDCreationTest < ActiveSupport::TestCase + end + + test 'find with multiple class no match' do +- assert_nil @person_gid.find(only: [Fixnum, Numeric]) +- assert_nil @person_uuid_gid.find(only: [Fixnum, String]) ++ assert_nil @person_gid.find(only: [0.class, Numeric]) ++ assert_nil @person_uuid_gid.find(only: [0.class, String]) + assert_nil @person_model_gid.find(only: [Array, Hash]) + assert_nil @person_namespaced_gid.find(only: [String, Set]) + end +@@ -111,8 +113,10 @@ class GlobalIDCreationTest < ActiveSupport::TestCase + test 'find with multiple module' do + assert_equal Person.find(@person_gid.model_id), + @person_gid.find(only: [Enumerable, GlobalID::Identification]) ++ bignum_class = RUBY_VERSION >= '2.4' ? Integer : Bignum + assert_equal Person.find(@person_uuid_gid.model_id), +- @person_uuid_gid.find(only: [Bignum, GlobalID::Identification]) ++ @person_uuid_gid.find(only: [bignum_class, ++ GlobalID::Identification]) + assert_equal PersonModel.find(@person_model_gid.model_id), + @person_model_gid.find(only: [String, ActiveModel::Model]) + assert_equal Person::Child.find(@person_namespaced_gid.model_id), diff --git a/SPECS/rubygem-globalid.spec b/SPECS/rubygem-globalid.spec new file mode 100644 index 0000000..5648b23 --- /dev/null +++ b/SPECS/rubygem-globalid.spec @@ -0,0 +1,125 @@ +%{?scl:%scl_package rubygem-%{gem_name}} +%{!?scl:%global pkg_name %{name}} + +# Generated from globalid-0.3.0.gem by gem2rpm -*- rpm-spec -*- +%global gem_name globalid + +%{?_with_bootstrap: %global bootstrap 1} + +Name: %{?scl_prefix}rubygem-%{gem_name} +Version: 0.3.6 +Release: 2%{?dist} +Summary: Refer to any model with a URI: gid://app/class/id +Group: Development/Languages +License: MIT +URL: http://www.rubyonrails.org +Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem +# git clone https://github.com/rails/globalid.git && cd globalid +# git checkout v0.3.6 +# tar czvf globalid-0.3.6-tests.tar.gz test/ +Source1: %{gem_name}-%{version}-tests.tar.gz +# Fix Fixnum/Bignum deprecated warning for Ruby 2.4.0. +# https://github.com/rails/globalid/commit/c1ef236 +Patch0: rubygem-globalid-0.3.7-fix-fixnum-bignum-warnings.patch + +Requires: %{?scl_prefix_ruby}ruby(release) +Requires: %{?scl_prefix_ruby}ruby(rubygems) +Requires: %{?scl_prefix}rubygem(activesupport) >= 4.1.0 +BuildRequires: %{?scl_prefix_ruby}ruby(release) +BuildRequires: %{?scl_prefix_ruby}rubygems-devel +BuildRequires: %{?scl_prefix_ruby}ruby >= 1.9.3 +%if ! 0%{?bootstrap} +BuildRequires: %{?scl_prefix}rubygem(activesupport) >= 4.1 +BuildRequires: %{?scl_prefix}rubygem(activemodel) >= 4.1 +BuildRequires: %{?scl_prefix}rubygem(railties) >= 4.1 +%endif +BuildArch: noarch +Provides: %{?scl_prefix}rubygem(%{gem_name}) = %{version} + +# Explicitly require runtime subpackage, as long as older scl-utils do not generate it +%{?scl:Requires: %{?scl_prefix}runtime} + +%description +URIs for your models makes it easy to pass references around. + +%package doc +Summary: Documentation for %{pkg_name} +Group: Documentation +Requires: %{?scl_prefix}%{pkg_name} = %{version}-%{release} +BuildArch: noarch + +%description doc +Documentation for %{pkg_name}. + +%prep +%{?scl:scl enable %{scl} - << \EOF} +set -e +gem unpack %{SOURCE0} + +%setup -q -D -T -n %{gem_name}-%{version} + +gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec +%{?scl:EOF} + + +%build +%{?scl:scl enable %{scl} - << \EOF} +set -e +gem build %{gem_name}.gemspec +%gem_install +%{?scl:EOF} + + +%install +mkdir -p %{buildroot}%{gem_dir} +cp -a .%{gem_dir}/* \ + %{buildroot}%{gem_dir}/ + +%if ! 0%{?bootstrap} +%check +pushd .%{gem_instdir} +tar xf %{SOURCE1} +cat %{PATCH0} | patch -p1 +sed -i '1d' ./test/helper.rb +%{?scl:scl enable %{scl} - << \EOF} +ruby -Ilib:test -rforwardable -e "Dir.glob './test/cases/*test.rb', &method(:require)" +%{?scl:EOF} +popd +%endif + +%files +# There is no %%license macro on RHEL6. +# https://bugzilla.redhat.com/show_bug.cgi?id=1386246 +%{!?_licensedir:%global license %%doc} + +%dir %{gem_instdir} +%{gem_libdir} +%license %{gem_instdir}/MIT-LICENSE +%{gem_instdir}/lib +%exclude %{gem_cache} +%{gem_spec} + +%files doc +%doc %{gem_docdir} + +%changelog +* Tue Feb 14 2017 Jun Aruga - 0.3.6-2 +- Fix Fixnum/Bignum deprecated warning for Ruby 2.4.0. + +* Tue Nov 08 2016 Jun Aruga - 0.3.6-1 +- Update to 0.3.6 + +* Mon Feb 22 2016 Pavel Valena - 0.3.3-4 +- Add scl macros + +* Thu Feb 04 2016 Fedora Release Engineering - 0.3.3-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Thu Jun 18 2015 Fedora Release Engineering - 0.3.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Thu Mar 19 2015 Josef Stribny - 0.3.3-1 +- Update to 0.3.3 + +* Tue Jan 06 2015 Josef Stribny - 0.3.0-1 +- Initial package