Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove support for erubis #1761

Merged
merged 2 commits into from
Feb 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

* Breaking change: Remove support for the Stylus template engine. [#1697](https://github.com/sinatra/sinatra/pull/1697) by Eloy Pérez

* Breaking change: Remove support for the erubis template engine. [#1761](https://github.com/sinatra/sinatra/pull/1761) by Eloy Pérez

* Breaking change: Remove support for the defunct Less templating library. See [#1716](https://github.com/sinatra/sinatra/issues/1716), [#1715](https://github.com/sinatra/sinatra/issues/1715) for more discussion and background. [d1af2f1e](https://github.com/sinatra/sinatra/commit/d1af2f1e6c8710419dfe3102a660f7a32f0e67e3) by Olle Jonsson

* Breaking change: Remove Reel integration. [54597502](https://github.com/sinatra/sinatra/commit/545975025927a27a1daca790598620038979f1c5) by Olle Jonsson
Expand Down Expand Up @@ -48,7 +50,7 @@

* Fix Delegator to pass keyword arguments for Ruby 3.0. [#1684](https://github.com/sinatra/sinatra/pull/1684) by andrewtblake

* Fix use with keyword arguments for Ruby 3.0. [#1701](https://github.com/sinatra/sinatra/pull/1701) by Robin Wallin
* Fix use with keyword arguments for Ruby 3.0. [#1701](https://github.com/sinatra/sinatra/pull/1701) by Robin Wallin

* Fix memory leaks for proc template. Fixes [#1704](https://github.com/sinatra/sinatra/issues/1714) [#1719](https://github.com/sinatra/sinatra/pull/1719) by Slevin

Expand Down
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ gem 'liquid'
gem 'rabl'
gem 'builder'
gem 'erubi'
gem 'erubis'
gem 'haml', '>= 3.0'
gem 'sass'
gem 'celluloid', '~> 0.16.0'
Expand Down
4 changes: 2 additions & 2 deletions README.de.md
Original file line number Diff line number Diff line change
Expand Up @@ -613,12 +613,12 @@ get('/') { markdown :index }
<table>
<tr>
<td>Abhängigkeit</td>
<td><a href="http://www.kuwata-lab.com/erubis/">erubis</a> oder erb
<td><a href="https://github.com/jeremyevans/erubi">erubi</a> oder erb
(Standardbibliothek von Ruby)</td>
</tr>
<tr>
<td>Dateierweiterungen</td>
<td><tt>.erb</tt>, <tt>.rhtml</tt> oder <tt>.erubis</tt> (nur Erubis)</td>
<td><tt>.erb</tt>, <tt>.rhtml</tt> oder <tt>.erubi</tt> (nur Erubi)</td>
</tr>
<tr>
<td>Beispiel</td>
Expand Down
6 changes: 3 additions & 3 deletions README.es.md
Original file line number Diff line number Diff line change
Expand Up @@ -618,13 +618,13 @@ get('/') { markdown :index }
<tr>
<td>Dependencias</td>
<td>
<a href="http://www.kuwata-lab.com/erubis/" title="erubis">erubis</a>
o erb (incluida en Ruby)
<a href="https://github.com/jeremyevans/erubi" title="erubi">erubi</a>
or erb (incluida in Ruby)
</td>
</tr>
<tr>
<td>Extensiones de Archivo</td>
<td><tt>.erb</tt>, <tt>.rhtml</tt> o <tt>.erubis</tt> (solamente con Erubis)</td>
<td><tt>.erb</tt>, <tt>.rhtml</tt> o <tt>.erubi</tt> (solamente con Erubi)</td>
</tr>
<tr>
<td>Ejemplo</td>
Expand Down
4 changes: 2 additions & 2 deletions README.fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -613,13 +613,13 @@ get('/') { markdown :index }
<tr>
<td>Dépendances</td>
<td>
<a href="http://www.kuwata-lab.com/erubis/" title="erubis">erubis</a>
<a href="https://github.com/jeremyevans/erubi" title="erubi">erubi</a>
ou erb (inclus avec Ruby)
</td>
</tr>
<tr>
<td>Extensions de fichier</td>
<td><tt>.erb</tt>, <tt>.rhtml</tt> ou <tt>.erubis</tt> (Erubis seulement)</td>
<td><tt>.erb</tt>, <tt>.rhtml</tt> ou <tt>.erubi</tt> (Erubi seulement)</td>
</tr>
<tr>
<td>Exemple</td>
Expand Down
3 changes: 1 addition & 2 deletions README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -555,13 +555,12 @@ get('/') { markdown :index }
<td>依存</td>
<td>
<a href="https://github.com/jeremyevans/erubi" title="erubi">erubi</a>
または <a href="http://www.kuwata-lab.com/erubis/" title="erubis">erubis</a>
または erb (Rubyに同梱)
</td>
</tr>
<tr>
<td>ファイル拡張子</td>
<td><tt>.erb</tt>, <tt>.rhtml</tt> または <tt>.erubi</tt> (Erubiだけ) または<tt>.erubis</tt> (Erubisだけ)</td>
<td><tt>.erb</tt>, <tt>.rhtml</tt> または <tt>.erubi</tt> (Erubiだけ) または</td>
</tr>
<tr>
<td>例</td>
Expand Down
4 changes: 2 additions & 2 deletions README.ko.md
Original file line number Diff line number Diff line change
Expand Up @@ -545,11 +545,11 @@ get('/') { markdown :index }
<table>
<tr>
<td>의존성</td>
<td><a href="http://www.kuwata-lab.com/erubis/">erubis</a> 또는 erb (루비 속에 포함)</td>
<td><a href="https://github.com/jeremyevans/erubi">erubi</a> 또는 erb (루비 속에 포함)</td>
</tr>
<tr>
<td>파일 확장자</td>
<td><tt>.erb</tt>, <tt>.rhtml</tt>, <tt>.erubis</tt> (Erubis만 해당)</td>
<td><tt>.erb</tt>, <tt>.rhtml</tt>, <tt>.erubi</tt> (Erubi만 해당)</td>
</tr>
<tr>
<td>예제</td>
Expand Down
4 changes: 2 additions & 2 deletions README.malayalam.md
Original file line number Diff line number Diff line change
Expand Up @@ -584,13 +584,13 @@ get('/') { markdown :index }
<tr>
<td>Dependency</td>
<td>
<a href="http://www.kuwata-lab.com/erubis/" title="erubis">erubis</a>
<a href="https://github.com/jeremyevans/erubi" title="erubi">erubi</a>
or erb (included in Ruby)
</td>
</tr>
<tr>
<td>File Extensions</td>
<td><tt>.erb</tt>, <tt>.rhtml</tt> or <tt>.erubis</tt> (Erubis only)</td>
<td><tt>.erb</tt>, <tt>.rhtml</tt> or <tt>.erubi</tt> (Erubi only)</td>
</tr>
<tr>
<td>Example</td>
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -610,14 +610,12 @@ get('/') { markdown :index }
<td>Dependency</td>
<td>
<a href="https://github.com/jeremyevans/erubi" title="erubi">erubi</a>
or <a href="http://www.kuwata-lab.com/erubis/" title="erubis">erubis</a>
or erb (included in Ruby)
</td>
</tr>
<tr>
<td>File Extensions</td>
<td><tt>.erb</tt>, <tt>.rhtml</tt> or <tt>.erubi</tt> (Erubi only)
or <tt>.erubis</tt> (Erubis only)</td>
<td><tt>.erb</tt>, <tt>.rhtml</tt> or <tt>.erubi</tt> (Erubi only)</td>
</tr>
<tr>
<td>Example</td>
Expand Down
4 changes: 1 addition & 3 deletions README.pl.md
Original file line number Diff line number Diff line change
Expand Up @@ -609,14 +609,12 @@ get('/') { markdown :index }
<td>Dependency</td>
<td>
<a href="https://github.com/jeremyevans/erubi" title="erubi">erubi</a>
or <a href="http://www.kuwata-lab.com/erubis/" title="erubis">erubis</a>
or erb (included in Ruby)
</td>
</tr>
<tr>
<td>File Extensions</td>
<td><tt>.erb</tt>, <tt>.rhtml</tt> or <tt>.erubi</tt> (Erubi only)
or <tt>.erubis</tt> (Erubis only)</td>
<td><tt>.erb</tt>, <tt>.rhtml</tt> or <tt>.erubi</tt> (Erubi only)</td>
</tr>
<tr>
<td>Example</td>
Expand Down
4 changes: 2 additions & 2 deletions README.pt-br.md
Original file line number Diff line number Diff line change
Expand Up @@ -634,13 +634,13 @@ get('/') { markdown :index }
<tr>
<td>Dependência</td>
<td>
<a href="http://www.kuwata-lab.com/erubis/" title="erubis">erubis</a>
<a href="https://github.com/jeremyevans/erubi" title="erubi">erubi</a>
or erb (included in Ruby)
</td>
</tr>
<tr>
<td>Extensão dos Arquivos</td>
<td><tt>.erb</tt>, <tt>.rhtml</tt> or <tt>.erubis</tt> (Erubis only)</td>
<td><tt>.erb</tt>, <tt>.rhtml</tt> or <tt>.erubi</tt> (Erubi only)</td>
</tr>
<tr>
<td>Exemplo</td>
Expand Down
15 changes: 0 additions & 15 deletions README.pt-pt.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,21 +185,6 @@ end

Renderiza `./views/index.erb`

### Erubis

A gem/biblioteca erubis é necessária para renderizar templates erubis:

```ruby
# É necessário requerir 'erubis' na aplicação.
require 'erubis'

get '/' do
erubis :index
end
```

Renderiza `./views/index.erubis`

### Builder Templates

A gem/biblioteca builder é necessária para renderizar templates builder:
Expand Down
4 changes: 2 additions & 2 deletions README.ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -612,13 +612,13 @@ get('/') { markdown :index }
<tr>
<td>Зависимости</td>
<td>
<a href="http://www.kuwata-lab.com/erubis/" title="erubis">erubis</a>
<a href="https://github.com/jeremyevans/erubi" title="erubi">erubi</a>
или erb (включён в Ruby)
</td>
</tr>
<tr>
<td>Расширения файлов</td>
<td><tt>.erb</tt>, <tt>.rhtml</tt> or <tt>.erubis</tt> (только Erubis)</td>
<td><tt>.erb</tt>, <tt>.rhtml</tt> or <tt>.erubi</tt> (только Erubi)</td>
</tr>
<tr>
<td>Пример</td>
Expand Down
4 changes: 2 additions & 2 deletions README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -548,13 +548,13 @@ get('/') { markdown :index }
<tr>
<td>依赖项</td>
<td>
<a href="http://www.kuwata-lab.com/erubis/" title="erubis">erubis</a>
<a href="http://www.kuwata-lab.com/erubi/" title="erubi">erubi</a>
或 erb (Ruby 标准库中已经包含)
</td>
</tr>
<tr>
<td>文件扩展名</td>
<td><tt>.erb</tt>, <tt>.rhtml</tt> or <tt>.erubis</tt> (仅用于 Erubis)</td>
<td><tt>.erb</tt>, <tt>.rhtml</tt> or <tt>.erubi</tt> (仅用于 Erubi)</td>
</tr>
<tr>
<td>例子</td>
Expand Down
6 changes: 0 additions & 6 deletions lib/sinatra/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -707,12 +707,6 @@ def erb(template, options = {}, locals = {}, &block)
render(:erb, template, options, locals, &block)
end

def erubis(template, options = {}, locals = {})
warn "Sinatra::Templates#erubis is deprecated and will be removed, use #erb instead.\n" \
"If you have Erubis installed, it will be used automatically."
render :erubis, template, options, locals
end

def haml(template, options = {}, locals = {}, &block)
render(:haml, template, options, locals, &block)
end
Expand Down
4 changes: 2 additions & 2 deletions sinatra-contrib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ Currently included:

* [`sinatra/config_file`][sinatra-config-file]: Allows loading configuration from yaml files.

* [`sinatra/content_for`][sinatra-content-for]: Adds Rails-style `content_for` helpers to Haml, Erb, Erubi,
Erubis and Slim.
* [`sinatra/content_for`][sinatra-content-for]: Adds Rails-style `content_for` helpers to Haml, Erb, Erubi
and Slim.

* [`sinatra/cookies`][sinatra-cookies]: A `cookies` helper for reading and writing cookies.

Expand Down
4 changes: 2 additions & 2 deletions sinatra-contrib/lib/sinatra/content_for.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module Sinatra
# blocks inside views to be rendered later during the request. The most
# common use is to populate different parts of your layout from your view.
#
# The currently supported engines are: Erb, Erubi, Erubis, Haml and Slim.
# The currently supported engines are: Erb, Erubi, Haml and Slim.
#
# == Usage
#
Expand Down Expand Up @@ -178,7 +178,7 @@ def yield_content(key, *args, &block)
else
content = content_blocks[key.to_sym].map { |b| capture(*args, &b) }
content.join.tap do |c|
if block_given? && (erb? || erubi? || erubis?)
if block_given? && (erb? || erubi?)
@_out_buf << c
end
end
Expand Down
11 changes: 1 addition & 10 deletions sinatra-contrib/lib/sinatra/engine_tracking.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,14 @@ def erb?
end

# Returns true if the current engine is `:erubi`, or `Tilt[:erb]` is set
# to Tilt::ErubisTemplate.
# to Tilt::ErubiTemplate.
#
# @return [Boolean] Returns true if current engine is `:erubi`.
def erubi?
@current_engine == :erubi or
erb? && Tilt[:erb] == Tilt::ErubiTemplate
end

# Returns true if the current engine is `:erubis`, or `Tilt[:erb]` is set
# to Tilt::ErubisTemplate.
#
# @return [Boolean] Returns true if current engine is `:erubis`.
def erubis?
@current_engine == :erubis or
erb? && Tilt[:erb] == Tilt::ErubisTemplate
end

# @return [Boolean] Returns true if current engine is `:haml`.
def haml?
@current_engine == :haml
Expand Down
2 changes: 1 addition & 1 deletion sinatra-contrib/lib/sinatra/namespace.rb
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ module NamespacedMethods
attr_reader :base, :templates

ALLOWED_ENGINES = [
:erb, :erubi, :erubis, :haml, :hamlit, :builder, :nokogiri, :sass, :scss,
:erb, :erubi, :haml, :hamlit, :builder, :nokogiri, :sass, :scss,
:liquid, :markdown, :textile, :rdoc, :asciidoc, :radius, :markaby,
:rabl, :slim, :creole, :mediawiki, :coffee, :yajl, :wlang
]
Expand Down
2 changes: 1 addition & 1 deletion sinatra-contrib/lib/sinatra/respond_with.rb
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def self.engines
:css => [:sass, :scss],
:xml => [:builder, :nokogiri],
:js => [:coffee],
:html => [:erb, :erubi, :erubis, :haml, :hamlit, :slim, :liquid, :radius,
:html => [:erb, :erubi, :haml, :hamlit, :slim, :liquid, :radius,
:mab, :markdown, :textile, :rdoc],
:all => (Sinatra::Templates.instance_methods.map(&:to_sym) +
[:mab] - [:find_template, :markaby]),
Expand Down
1 change: 0 additions & 1 deletion sinatra-contrib/sinatra-contrib.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ EOF
s.add_development_dependency "rspec", "~> 3"
s.add_development_dependency "haml"
s.add_development_dependency "erubi"
s.add_development_dependency "erubis"
s.add_development_dependency "slim"
s.add_development_dependency "sass"
s.add_development_dependency "builder"
Expand Down
3 changes: 1 addition & 2 deletions sinatra-contrib/spec/capture_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def render(engine, template)

shared_examples_for "a template language" do |engine|
lang = engine
if engine == :erubi || engine == :erubis
if engine == :erubi
lang = :erb
end
if engine == :hamlit
Expand All @@ -41,7 +41,6 @@ def render(engine, template)
describe('hamlit') { it_behaves_like "a template language", :hamlit }
describe('slim') { it_behaves_like "a template language", :slim }
describe('erubi') { it_behaves_like "a template language", :erubi }
describe('erubis') { it_behaves_like "a template language", :erubis }

describe 'erb' do
it_behaves_like "a template language", :erb
Expand Down
2 changes: 1 addition & 1 deletion sinatra-contrib/spec/content_for_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def render(engine, template)
end

# TODO: liquid radius markaby builder nokogiri
engines = %w[erb erubi erubis haml hamlit slim]
engines = %w[erb erubi haml hamlit slim]

engines.each do |inner|
describe inner.capitalize do
Expand Down
9 changes: 0 additions & 9 deletions test/erb_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,3 @@ def engine; Tilt::ErubiTemplate end
rescue LoadError
warn "#{$!}: skipping erubi tests"
end

begin
require 'erubis'
class ErubisTest < ERBTest
def engine; Tilt::ErubisTemplate end
end
rescue LoadError
warn "#{$!}: skipping erubis tests"
end