package init

This commit is contained in:
jackie_wu 2020-08-18 16:32:37 +08:00
parent e0ad042390
commit 3e0658c772
5 changed files with 155 additions and 0 deletions

View File

@ -0,0 +1,60 @@
From cc54e7dff9aa2a20be632f450db8ae3c31046edf Mon Sep 17 00:00:00 2001
From: Fabio Valentini <decathorpe@gmail.com>
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

View File

@ -0,0 +1,25 @@
From d991316f9ded539c9b6f0f1a8bfb95db197567ac Mon Sep 17 00:00:00 2001
From: Fabio Valentini <decathorpe@gmail.com>
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

BIN
liquid-4.0.3.gem Normal file

Binary file not shown.

66
rubygem-liquid.spec Normal file
View File

@ -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 <wutao61@huawei.com> - 4.0.3-1
- package init

4
rubygem-liquid.yaml Normal file
View File

@ -0,0 +1,4 @@
version_control: github
src_repo: Shopify/liquid
tag_prefix: "^v"
seperator: "."