commit deed67a5ccaf6fe0795d7faf5e0e532058b17e94 Author: tigro Date: Tue Sep 26 13:34:06 2023 +0300 import rubygem-slim-4.1.0-7.el9 diff --git a/.rubygem-slim.metadata b/.rubygem-slim.metadata new file mode 100644 index 0000000..e69de29 diff --git a/SOURCES/rubygem-slim-4.1.0-Fix-build-for-Rails.patch b/SOURCES/rubygem-slim-4.1.0-Fix-build-for-Rails.patch new file mode 100644 index 0000000..936a6e9 --- /dev/null +++ b/SOURCES/rubygem-slim-4.1.0-Fix-build-for-Rails.patch @@ -0,0 +1,49 @@ +From 20651953fc6b9768d85698f6971c997a222d36a6 Mon Sep 17 00:00:00 2001 +From: Nathaniel Watts <1141717+thewatts@users.noreply.github.com> +Date: Fri, 20 Mar 2020 23:16:37 -0500 +Subject: [PATCH] Fix build for Rails + +Looking at the build pipeline, the build stopped failing without any changes to the code that would indicate a problem. + +The only thing that I could discern was that a dependency must have gotten an update causing the failure. + +After doing some digging, I saw that `Sprockets` had gotten a major release to `4.0.0`. + +The configuration in `test/rails/config/application.rb`, the source of the build failure, checks to see if the `Sprockets` version is > 3. + +If so, it triggers some code that was also used in [`slim-rails`](https://github.com/slim-template/slim-rails/blob/b19741ba76a09a3badd0c5145dea6b087064fb87/lib/slim-rails/register_engine.rb#L31-L39), per [this commit from a couple years ago](https://github.com/slim-template/slim/commit/14a845a75047fd564acdc940c25f9bab599bbb9c). + +The code works fine in `slim-rails` because `RegisterEngine` [lives in `slim-rails`](https://github.com/slim-template/slim-rails/blob/b19741ba76a09a3badd0c5145dea6b087064fb87/lib/slim-rails/register_engine.rb#L1), but unfortunately does not exist in the core `slim` project, causing the `NameError`. + +I suppose this was missed because until recently `Sprockets` was < 4.0 and the code written a couple years back never needed to run. + +To fix this, I added the `slim-rails` gem to the `Gemfile`, and included the missing `RegisterEngine` module. +--- + test/rails/config/application.rb | 5 +++-- + 1 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/test/rails/config/application.rb b/test/rails/config/application.rb +index 7bd6d2f6..09463ac5 100644 +--- a/test/rails/config/application.rb ++++ b/test/rails/config/application.rb +@@ -5,9 +5,10 @@ + require 'action_view/railtie' + #require 'active_record/railtie' + #require 'action_mailer/railtie' +-require "sprockets/railtie" ++require 'sprockets/railtie' + + require 'slim' ++require 'slim-rails/register_engine' + + module Dummy + class Application < Rails::Application +@@ -48,7 +49,7 @@ class Application < Rails::Application + config.assets.configure do |env| + if env.respond_to?(:register_transformer) && Sprockets::VERSION.to_i > 3 + env.register_mime_type 'text/slim', extensions: ['.slim', '.slim.html'] +- env.register_transformer 'text/slim', 'text/html', RegisterEngine::Transformer ++ env.register_transformer 'text/slim', 'text/html', Slim::Rails::RegisterEngine::Transformer + elsif env.respond_to?(:register_engine) + args = ['.slim', Slim::Template] + args << { silence_deprecation: true } if Sprockets::VERSION.start_with?('3') diff --git a/SOURCES/rubygem-slim-4.1.0-see-if-this-fixes-the-unknown-line-indicator.patch b/SOURCES/rubygem-slim-4.1.0-see-if-this-fixes-the-unknown-line-indicator.patch new file mode 100644 index 0000000..4828cec --- /dev/null +++ b/SOURCES/rubygem-slim-4.1.0-see-if-this-fixes-the-unknown-line-indicator.patch @@ -0,0 +1,43 @@ +From 14a845a75047fd564acdc940c25f9bab599bbb9c Mon Sep 17 00:00:00 2001 +From: stonean +Date: Sun, 27 May 2018 15:03:22 -0400 +Subject: [PATCH] see if this fixes the unknown line indicator. worked for + slim-rails :) + +--- + test/rails/config/application.rb | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +diff --git a/test/rails/config/application.rb b/test/rails/config/application.rb +index bbbd15fc..7bd6d2f6 100644 +--- a/test/rails/config/application.rb ++++ b/test/rails/config/application.rb +@@ -5,6 +5,7 @@ + require 'action_view/railtie' + #require 'active_record/railtie' + #require 'action_mailer/railtie' ++require "sprockets/railtie" + + require 'slim' + +@@ -40,5 +41,20 @@ class Application < Rails::Application + + # Configure sensitive parameters which will be filtered from the log file. + config.filter_parameters += [:password] ++ ++ # From slim-rails fix for "ActionView::Template::Error: Unknown line indicator" ++ # https://github.com/slim-template/slim-rails/blob/991589ea5648e5e896781e68912bc51beaf4102a/lib/slim-rails/register_engine.rb ++ if config.respond_to?(:assets) ++ config.assets.configure do |env| ++ if env.respond_to?(:register_transformer) && Sprockets::VERSION.to_i > 3 ++ env.register_mime_type 'text/slim', extensions: ['.slim', '.slim.html'] ++ env.register_transformer 'text/slim', 'text/html', RegisterEngine::Transformer ++ elsif env.respond_to?(:register_engine) ++ args = ['.slim', Slim::Template] ++ args << { silence_deprecation: true } if Sprockets::VERSION.start_with?('3') ++ env.register_engine(*args) ++ end ++ end ++ end + end + end diff --git a/SOURCES/slim-4.1.0.gem b/SOURCES/slim-4.1.0.gem new file mode 100644 index 0000000..ca6e6c2 Binary files /dev/null and b/SOURCES/slim-4.1.0.gem differ diff --git a/SPECS/rubygem-slim.spec b/SPECS/rubygem-slim.spec new file mode 100644 index 0000000..035aa2e --- /dev/null +++ b/SPECS/rubygem-slim.spec @@ -0,0 +1,211 @@ +# Generated from slim-1.2.2.gem by gem2rpm -*- rpm-spec -*- +%global gem_name slim + +Name: rubygem-%{gem_name} +Version: 4.1.0 +Release: 7%{?dist} +Summary: Slim is a template language +License: MIT +URL: http://slim-lang.com/ +Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem +# These are to revert dependency on sprocket-rails and slim-rails, because: +# 1) It is not really clear what the dependencies actually fix (there is no +# test error without them). +# 2) We don't want the sprockets-rails and slim-rails dependency. +# https://github.com/slim-template/slim/commit/14a845a75047fd564acdc940c25f9bab599bbb9c +Patch0: rubygem-slim-4.1.0-see-if-this-fixes-the-unknown-line-indicator.patch +# https://github.com/slim-template/slim/pull/844 +Patch1: rubygem-slim-4.1.0-Fix-build-for-Rails.patch +BuildRequires: ruby(release) +BuildRequires: rubygems-devel +BuildRequires: ruby +BuildRequires: rubygem(minitest) +BuildRequires: rubygem(sinatra) +BuildRequires: rubygem(activemodel) +BuildRequires: rubygem(rails-controller-testing) +BuildRequires: rubygem(railties) +BuildRequires: rubygem(kramdown) +BuildRequires: rubygem(sassc) +BuildRequires: rubygem(temple) +BuildRequires: rubygem(tilt) +BuildArch: noarch + +%description +Slim is a template language whose goal is reduce the syntax to the essential +parts without becoming cryptic. + + +%package doc +Summary: Documentation for %{name} +Requires: %{name} = %{version}-%{release} +BuildArch: noarch + +%description doc +Documentation for %{name}. + +%prep +%setup -q -n %{gem_name}-%{version} + +%patch1 -p1 -R +%patch0 -p1 -R + +%build +gem build ../%{gem_name}-%{version}.gemspec +%gem_install + +%install +mkdir -p %{buildroot}%{gem_dir} +cp -a .%{gem_dir}/* \ + %{buildroot}%{gem_dir}/ + + +mkdir -p %{buildroot}%{_bindir} +cp -a .%{_bindir}/* \ + %{buildroot}%{_bindir}/ + +find %{buildroot}%{gem_instdir}/bin -type f | xargs chmod a+x + +%check +pushd .%{gem_instdir} +ruby -Ilib:test/core -rostruct -e 'Dir.glob "./test/core/**/test_*.rb", &method(:require)' +ruby -Ilib:test/core -e 'Dir.glob "./test/include/**/test_*.rb", &method(:require)' +ruby -Ilib:test/literate test/literate/run.rb +ruby -Ilib:test/core -e 'Dir.glob "./test/logic_less/**/test_*.rb", &method(:require)' +ruby -Ilib -e 'Dir.glob "./test/rails/**/test_*.rb", &method(:require)' +ruby -Ilib -e 'Dir.glob "./test/sinatra/**/test_*.rb", &method(:require)' +ruby -Ilib:test/core -e 'Dir.glob "./test/smart/**/test_*.rb", &method(:require)' +ruby -Ilib:test/core -e 'Dir.glob "./test/translator/**/test_*.rb", &method(:require)' +popd + +%files +%dir %{gem_instdir} +%{_bindir}/slimrb +%exclude %{gem_instdir}/.* +%license %{gem_instdir}/LICENSE +%{gem_instdir}/bin +%{gem_libdir} +%exclude %{gem_cache} +%{gem_spec} + +%files doc +%doc %{gem_docdir} +%{gem_instdir}/Gemfile +%lang(ja) %doc %{gem_instdir}/README.jp.md +%doc %{gem_instdir}/CHANGES +%doc %{gem_instdir}/README.md +%{gem_instdir}/benchmarks/ +%{gem_instdir}/Rakefile +%dir %{gem_instdir}/doc +%doc %{gem_instdir}/doc/*.md +%lang(ja) %doc %{gem_instdir}/doc/jp +%{gem_instdir}/slim.gemspec +%{gem_instdir}/test + +%changelog +* Tue Sep 26 2023 Arkady L. Shane - 4.1.0-7 +- Rebuilt for MSVSphere 9.2 + +* Fri Jan 20 2023 Fedora Release Engineering - 4.1.0-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Sat Jul 23 2022 Fedora Release Engineering - 4.1.0-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Fri Jan 21 2022 Fedora Release Engineering - 4.1.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Fri Jul 23 2021 Fedora Release Engineering - 4.1.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Wed Jan 27 2021 Fedora Release Engineering - 4.1.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Wed Jul 29 2020 Fedora Release Engineering - 4.1.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Mon May 11 2020 Vít Ondruch - 4.1.0-1 +- Update to Slim 4.1.0. + Resolves: rhbz#1833182 + +* Thu Jan 30 2020 Fedora Release Engineering - 3.0.9-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Fri Jul 26 2019 Fedora Release Engineering - 3.0.9-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Sat Feb 02 2019 Fedora Release Engineering - 3.0.9-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Sat Jul 14 2018 Fedora Release Engineering - 3.0.9-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Wed Jul 04 2018 Vít Ondruch - 3.0.9-1 +- Update to Slim 3.0.9. + +* Fri Feb 09 2018 Fedora Release Engineering - 3.0.8-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Thu Jul 27 2017 Fedora Release Engineering - 3.0.8-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Thu Jun 01 2017 Vít Ondruch - 3.0.8-1 +- Update to Slim 3.0.8. + +* Sat Feb 11 2017 Fedora Release Engineering - 3.0.7-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Mon Nov 28 2016 Vít Ondruch - 3.0.7-1 +- Update to Slim 3.0.7. + +* Thu Feb 04 2016 Fedora Release Engineering - 2.0.2-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Thu Jun 18 2015 Fedora Release Engineering - 2.0.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Fri Jun 20 2014 Vít Ondruch - 2.0.2-1 +- Update to Slim 2.0.2. + +* Sun Jun 08 2014 Fedora Release Engineering - 1.3.8-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Sun Aug 04 2013 Fedora Release Engineering - 1.3.8-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Wed Apr 17 2013 Josef Stribny - 1.3.8-2 +- Fix runtime requirement of temple version + +* Mon Apr 15 2013 Josef Stribny - 1.3.8-1 +- Rebuild for https://fedoraproject.org/wiki/Features/Ruby_2.0.0 +- Update to slim 1.3.8 + +* Thu Feb 14 2013 Fedora Release Engineering - 1.2.2-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Fri Oct 19 2012 - 1.2.2-8 +- Excluded gem cache +- Check goes after install section + +* Wed Oct 17 2012 - 1.2.2-7 +- Split prep to prep and build sections +- Made nonexecutable scripts executable +- Owning whole test/ directory + +* Tue Oct 16 2012 - 1.2.2-6 +- Fixed markdown test + +* Thu Oct 11 2012 - 1.2.2-5 +- Now owning test and benchmarks directories + +* Wed Oct 10 2012 - 1.2.2-4 +- Added deps for rails tests. Runs tests. + +* Mon Oct 08 2012 - 1.2.2-3 +- Moved tests to doc, removed unnecessary files, some minor corrections +- Not running tests (missing deps) + +* Mon Sep 03 2012 - 1.2.2-2 +- Removed unnecessary files & corrected license + +* Wed Jul 11 2012 - 1.2.2-1 +- Initial package