!2 Use Erubi instead of Erubis
From: @lyn1001 Reviewed-by: @small_leek Signed-off-by: @small_leek
This commit is contained in:
commit
7b6713f6fc
81
rubygem-temple-0.8.2-Use-Erubi-instead-of-Erubis.patch
Normal file
81
rubygem-temple-0.8.2-Use-Erubi-instead-of-Erubis.patch
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
From 8d6612db8086e5c839f045a1057daaad147383d0 Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
|
||||||
|
Date: Wed, 19 Aug 2020 14:19:22 +0200
|
||||||
|
Subject: [PATCH] Use Erubi instead of Erubis.
|
||||||
|
|
||||||
|
Erubis is dead upstream for almost past 10 years, while Erubi is more
|
||||||
|
lightweight alternative used by Ruby on Rails these days.
|
||||||
|
---
|
||||||
|
temple.gemspec | 2 +-
|
||||||
|
test/helper.rb | 4 ++--
|
||||||
|
test/test_erb.rb | 10 +++++-----
|
||||||
|
3 files changed, 8 insertions(+), 8 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/temple.gemspec b/temple.gemspec
|
||||||
|
index 8a84aee..2f1aa60 100644
|
||||||
|
--- a/temple.gemspec
|
||||||
|
+++ b/temple.gemspec
|
||||||
|
@@ -25,5 +25,5 @@ Gem::Specification.new do |s|
|
||||||
|
s.add_development_dependency('tilt')
|
||||||
|
s.add_development_dependency('bacon')
|
||||||
|
s.add_development_dependency('rake')
|
||||||
|
- s.add_development_dependency('erubis')
|
||||||
|
+ s.add_development_dependency('erubi')
|
||||||
|
end
|
||||||
|
diff --git a/test/helper.rb b/test/helper.rb
|
||||||
|
index 608c54d..e06a90e 100644
|
||||||
|
--- a/test/helper.rb
|
||||||
|
+++ b/test/helper.rb
|
||||||
|
@@ -20,8 +20,8 @@ module TestHelper
|
||||||
|
Temple::ERB::Template.new(options) { src }.render
|
||||||
|
end
|
||||||
|
|
||||||
|
- def erubis(src, options = {})
|
||||||
|
- Tilt::ErubisTemplate.new(options) { src }.render
|
||||||
|
+ def erubi(src, options = {})
|
||||||
|
+ Tilt::ErubiTemplate.new(options) { src }.render
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
diff --git a/test/test_erb.rb b/test/test_erb.rb
|
||||||
|
index a82a1a2..31f39cc 100644
|
||||||
|
--- a/test/test_erb.rb
|
||||||
|
+++ b/test/test_erb.rb
|
||||||
|
@@ -1,5 +1,5 @@
|
||||||
|
require 'helper'
|
||||||
|
-require 'tilt/erubis'
|
||||||
|
+require 'tilt/erubi'
|
||||||
|
|
||||||
|
describe Temple::ERB::Engine do
|
||||||
|
it 'should compile erb' do
|
||||||
|
@@ -11,7 +11,7 @@ describe Temple::ERB::Engine do
|
||||||
|
<% end %>
|
||||||
|
}
|
||||||
|
|
||||||
|
- erb(src).should.equal erubis(src)
|
||||||
|
+ erb(src).should.equal erubi(src)
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'should recognize comments' do
|
||||||
|
@@ -20,7 +20,7 @@ hello
|
||||||
|
<%# comment -- ignored -- useful in testing %>
|
||||||
|
world}
|
||||||
|
|
||||||
|
- erb(src).should.equal erubis(src)
|
||||||
|
+ erb(src).should.equal erubi(src)
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'should recognize <%% and %%>' do
|
||||||
|
@@ -55,7 +55,7 @@ world}
|
||||||
|
<% end %>
|
||||||
|
}
|
||||||
|
|
||||||
|
- erb(src, trim: true).should.equal erubis(src, trim: true)
|
||||||
|
- erb(src, trim: false).should.equal erubis(src, trim: false)
|
||||||
|
+ erb(src, trim: true).should.equal erubi(src, trim: true)
|
||||||
|
+ erb(src, trim: false).should.equal erubi(src, trim: false)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
@ -1,12 +1,13 @@
|
|||||||
%global gem_name temple
|
%global gem_name temple
|
||||||
Name: rubygem-%{gem_name}
|
Name: rubygem-%{gem_name}
|
||||||
Version: 0.8.0
|
Version: 0.8.0
|
||||||
Release: 1
|
Release: 2
|
||||||
Summary: Template compilation framework in Ruby
|
Summary: Template compilation framework in Ruby
|
||||||
License: MIT
|
License: MIT
|
||||||
URL: https://github.com/judofyr/temple
|
URL: https://github.com/judofyr/temple
|
||||||
Source0: https://rubygems.org/gems/temple-%{version}.gem
|
Source0: https://rubygems.org/gems/temple-%{version}.gem
|
||||||
BuildRequires: ruby(release) rubygems-devel ruby rubygem-bacon rubygem(erubis) rubygem(tilt)
|
Patch0: rubygem-temple-0.8.2-Use-Erubi-instead-of-Erubis.patch
|
||||||
|
BuildRequires: ruby(release) rubygems-devel ruby rubygem-bacon rubygem(erubi) rubygem(tilt)
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
%description
|
%description
|
||||||
Temple is an abstraction and a framework for compiling templates to pure Ruby.
|
Temple is an abstraction and a framework for compiling templates to pure Ruby.
|
||||||
@ -25,10 +26,14 @@ Obsoletes: %{name}-doc < %{version}-%{release}
|
|||||||
Documentation for %{name}.
|
Documentation for %{name}.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -c -T
|
%setup -q -n %{gem_name}-%{version}
|
||||||
%gem_install -n %{SOURCE0}
|
|
||||||
|
%patch0 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
gem build ../%{gem_name}-%{version}.gemspec
|
||||||
|
|
||||||
|
%gem_install
|
||||||
|
|
||||||
%install
|
%install
|
||||||
mkdir -p %{buildroot}%{gem_dir}
|
mkdir -p %{buildroot}%{gem_dir}
|
||||||
@ -59,5 +64,8 @@ popd
|
|||||||
%{gem_instdir}/test
|
%{gem_instdir}/test
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Jan 10 liyanan <liyanan32@h-partners.com> - 0.8.0-2
|
||||||
|
- Use Erubi instead of Erubis
|
||||||
|
|
||||||
* Sat Aug 22 2020 liyanan <liyanan32@huawei.com> - 0.8.0-1
|
* Sat Aug 22 2020 liyanan <liyanan32@huawei.com> - 0.8.0-1
|
||||||
- package init
|
- package init
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user