|
|
ae616d8 |
From 8d6612db8086e5c839f045a1057daaad147383d0 Mon Sep 17 00:00:00 2001
|
|
|
ae616d8 |
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
|
|
|
ae616d8 |
Date: Wed, 19 Aug 2020 14:19:22 +0200
|
|
|
ae616d8 |
Subject: [PATCH] Use Erubi instead of Erubis.
|
|
|
ae616d8 |
|
|
|
ae616d8 |
Erubis is dead upstream for almost past 10 years, while Erubi is more
|
|
|
ae616d8 |
lightweight alternative used by Ruby on Rails these days.
|
|
|
ae616d8 |
---
|
|
|
ae616d8 |
temple.gemspec | 2 +-
|
|
|
ae616d8 |
test/helper.rb | 4 ++--
|
|
|
ae616d8 |
test/test_erb.rb | 10 +++++-----
|
|
|
ae616d8 |
3 files changed, 8 insertions(+), 8 deletions(-)
|
|
|
ae616d8 |
|
|
|
ae616d8 |
diff --git a/temple.gemspec b/temple.gemspec
|
|
|
ae616d8 |
index 8a84aee..2f1aa60 100644
|
|
|
ae616d8 |
--- a/temple.gemspec
|
|
|
ae616d8 |
+++ b/temple.gemspec
|
|
|
ae616d8 |
@@ -25,5 +25,5 @@ Gem::Specification.new do |s|
|
|
|
ae616d8 |
s.add_development_dependency('tilt')
|
|
|
ae616d8 |
s.add_development_dependency('bacon')
|
|
|
ae616d8 |
s.add_development_dependency('rake')
|
|
|
ae616d8 |
- s.add_development_dependency('erubis')
|
|
|
ae616d8 |
+ s.add_development_dependency('erubi')
|
|
|
ae616d8 |
end
|
|
|
ae616d8 |
diff --git a/test/helper.rb b/test/helper.rb
|
|
|
ae616d8 |
index 608c54d..e06a90e 100644
|
|
|
ae616d8 |
--- a/test/helper.rb
|
|
|
ae616d8 |
+++ b/test/helper.rb
|
|
|
ae616d8 |
@@ -20,8 +20,8 @@ module TestHelper
|
|
|
ae616d8 |
Temple::ERB::Template.new(options) { src }.render
|
|
|
ae616d8 |
end
|
|
|
ae616d8 |
|
|
|
ae616d8 |
- def erubis(src, options = {})
|
|
|
ae616d8 |
- Tilt::ErubisTemplate.new(options) { src }.render
|
|
|
ae616d8 |
+ def erubi(src, options = {})
|
|
|
ae616d8 |
+ Tilt::ErubiTemplate.new(options) { src }.render
|
|
|
ae616d8 |
end
|
|
|
ae616d8 |
end
|
|
|
ae616d8 |
|
|
|
ae616d8 |
diff --git a/test/test_erb.rb b/test/test_erb.rb
|
|
|
ae616d8 |
index a82a1a2..31f39cc 100644
|
|
|
ae616d8 |
--- a/test/test_erb.rb
|
|
|
ae616d8 |
+++ b/test/test_erb.rb
|
|
|
ae616d8 |
@@ -1,5 +1,5 @@
|
|
|
ae616d8 |
require 'helper'
|
|
|
ae616d8 |
-require 'tilt/erubis'
|
|
|
ae616d8 |
+require 'tilt/erubi'
|
|
|
ae616d8 |
|
|
|
ae616d8 |
describe Temple::ERB::Engine do
|
|
|
ae616d8 |
it 'should compile erb' do
|
|
|
ae616d8 |
@@ -11,7 +11,7 @@ describe Temple::ERB::Engine do
|
|
|
ae616d8 |
<% end %>
|
|
|
ae616d8 |
}
|
|
|
ae616d8 |
|
|
|
ae616d8 |
- erb(src).should.equal erubis(src)
|
|
|
ae616d8 |
+ erb(src).should.equal erubi(src)
|
|
|
ae616d8 |
end
|
|
|
ae616d8 |
|
|
|
ae616d8 |
it 'should recognize comments' do
|
|
|
ae616d8 |
@@ -20,7 +20,7 @@ hello
|
|
|
ae616d8 |
<%# comment -- ignored -- useful in testing %>
|
|
|
ae616d8 |
world}
|
|
|
ae616d8 |
|
|
|
ae616d8 |
- erb(src).should.equal erubis(src)
|
|
|
ae616d8 |
+ erb(src).should.equal erubi(src)
|
|
|
ae616d8 |
end
|
|
|
ae616d8 |
|
|
|
ae616d8 |
it 'should recognize <%% and %%>' do
|
|
|
ae616d8 |
@@ -55,7 +55,7 @@ world}
|
|
|
ae616d8 |
<% end %>
|
|
|
ae616d8 |
}
|
|
|
ae616d8 |
|
|
|
ae616d8 |
- erb(src, trim: true).should.equal erubis(src, trim: true)
|
|
|
ae616d8 |
- erb(src, trim: false).should.equal erubis(src, trim: false)
|
|
|
ae616d8 |
+ erb(src, trim: true).should.equal erubi(src, trim: true)
|
|
|
ae616d8 |
+ erb(src, trim: false).should.equal erubi(src, trim: false)
|
|
|
ae616d8 |
end
|
|
|
ae616d8 |
end
|
|
|
ae616d8 |
--
|
|
|
ae616d8 |
2.27.0
|
|
|
ae616d8 |
|