diff --git a/01-test-unit-context-disable-stack-profiler.patch b/01-test-unit-context-disable-stack-profiler.patch new file mode 100644 index 0000000..17a7b6e --- /dev/null +++ b/01-test-unit-context-disable-stack-profiler.patch @@ -0,0 +1,60 @@ +From cc54e7dff9aa2a20be632f450db8ae3c31046edf Mon Sep 17 00:00:00 2001 +From: Fabio Valentini +Date: Sat, 9 Mar 2019 20:38:31 +0100 +Subject: [PATCH 1/2] test/unit/context: disable stack profiler + +--- + test/unit/context_unit_test.rb | 32 ++++++++++++++++---------------- + 1 file changed, 16 insertions(+), 16 deletions(-) + +diff --git a/test/unit/context_unit_test.rb b/test/unit/context_unit_test.rb +index fab19b8..1d59a31 100644 +--- a/test/unit/context_unit_test.rb ++++ b/test/unit/context_unit_test.rb +@@ -446,11 +446,11 @@ class ContextUnitTest < Minitest::Test + assert_equal @context, @context['category'].context + end + +- def test_interrupt_avoids_object_allocations +- assert_no_object_allocations do +- @context.interrupt? +- end +- end ++ # def test_interrupt_avoids_object_allocations ++ # assert_no_object_allocations do ++ # @context.interrupt? ++ # end ++ # end + + def test_context_initialization_with_a_proc_in_environment + contx = Context.new([test: ->(c) { c['poutine'] }], { test: :foo }) +@@ -475,15 +475,15 @@ class ContextUnitTest < Minitest::Test + + private + +- def assert_no_object_allocations +- unless RUBY_ENGINE == 'ruby' +- skip "stackprof needed to count object allocations" +- end +- require 'stackprof' +- +- profile = StackProf.run(mode: :object) do +- yield +- end +- assert_equal 0, profile[:samples] +- end ++# def assert_no_object_allocations ++# unless RUBY_ENGINE == 'ruby' ++# skip "stackprof needed to count object allocations" ++# end ++# require 'stackprof' ++ ++# profile = StackProf.run(mode: :object) do ++# yield ++# end ++# assert_equal 0, profile[:samples] ++# end + end # ContextTest +-- +2.20.1 + diff --git a/02-test-helper-remove-shebang-and-executable-bit.patch b/02-test-helper-remove-shebang-and-executable-bit.patch new file mode 100644 index 0000000..840a214 --- /dev/null +++ b/02-test-helper-remove-shebang-and-executable-bit.patch @@ -0,0 +1,25 @@ +From d991316f9ded539c9b6f0f1a8bfb95db197567ac Mon Sep 17 00:00:00 2001 +From: Fabio Valentini +Date: Sat, 9 Mar 2019 20:38:45 +0100 +Subject: [PATCH 2/2] test/helper: remove shebang and executable bit + +--- + test/test_helper.rb | 2 -- + 1 file changed, 2 deletions(-) + mode change 100755 => 100644 test/test_helper.rb + +diff --git a/test/test_helper.rb b/test/test_helper.rb +old mode 100755 +new mode 100644 +index ac5ab53..18e464a +--- a/test/test_helper.rb ++++ b/test/test_helper.rb +@@ -1,5 +1,3 @@ +-#!/usr/bin/env ruby +- + ENV["MT_NO_EXPECTATIONS"] = "1" + require 'minitest/autorun' + +-- +2.20.1 + diff --git a/liquid-4.0.3.gem b/liquid-4.0.3.gem new file mode 100644 index 0000000..1cb8bcb Binary files /dev/null and b/liquid-4.0.3.gem differ diff --git a/rubygem-liquid.spec b/rubygem-liquid.spec new file mode 100644 index 0000000..21b5b5a --- /dev/null +++ b/rubygem-liquid.spec @@ -0,0 +1,66 @@ +%global gem_name liquid +Name: rubygem-%{gem_name} +Summary: Secure, non-evaling end user template engine +Version: 4.0.3 +Release: 1 +License: MIT +URL: http://www.liquidmarkup.org +Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem +Patch1: 01-test-unit-context-disable-stack-profiler.patch +Patch2: 02-test-helper-remove-shebang-and-executable-bit.patch +BuildArch: noarch +BuildRequires: ruby(release) ruby >= 2.1.0 rubygems-devel >= 1.3.7 +BuildRequires: rubygem(bigdecimal) rubygem(minitest) +Requires: rubygem(bigdecimal) +%description +Liquid is a template engine which was written with very specific requirements: +* It has to have beautiful and simple markup. Template engines which don't + produce good looking markup are no fun to use. +* It needs to be non evaling and secure. Liquid templates are made so that + users can edit them. You don't want to run code on your server which your + users wrote. +* It has to be stateless. Compile and render steps have to be separate so that + the expensive parsing and compiling can be done once and later on you can + just render it passing in a hash with local variables and objects. + +%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 +%patch2 -p1 + +%build +gem build ../%{gem_name}-%{version}.gemspec +%gem_install + +%install +mkdir -p %{buildroot}%{gem_dir} +cp -a ./%{gem_dir}/* %{buildroot}%{gem_dir}/ + +%check +pushd .%{gem_instdir} +ruby -I"lib:test" -e 'Dir.glob "./test/**/*_test.rb", &method(:require)' +popd + +%files +%license %{gem_instdir}/LICENSE +%dir %{gem_instdir} +%{gem_libdir} +%{gem_spec} +%exclude %{gem_cache} + +%files doc +%doc %{gem_instdir}/History.md +%doc %{gem_instdir}/README.md +%doc %{gem_docdir} +%{gem_instdir}/test + +%changelog +* Thu Jul 30 2020 wutao - 4.0.3-1 +- package init diff --git a/rubygem-liquid.yaml b/rubygem-liquid.yaml new file mode 100644 index 0000000..9138e7c --- /dev/null +++ b/rubygem-liquid.yaml @@ -0,0 +1,4 @@ +version_control: github +src_repo: Shopify/liquid +tag_prefix: "^v" +seperator: "."