Remove support for erubis
This commit is contained in:
parent
40349624e7
commit
e1eaa9322c
1
Gemfile
1
Gemfile
|
@ -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'
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -707,12 +707,6 @@ module Sinatra
|
|||
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
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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
|
||||
#
|
||||
|
@ -178,7 +178,7 @@ module Sinatra
|
|||
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
|
||||
|
|
|
@ -12,7 +12,7 @@ module Sinatra
|
|||
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?
|
||||
|
@ -20,15 +20,6 @@ module Sinatra
|
|||
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
|
||||
|
|
|
@ -225,7 +225,7 @@ module Sinatra
|
|||
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
|
||||
]
|
||||
|
|
|
@ -240,7 +240,7 @@ module Sinatra
|
|||
: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]),
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -20,7 +20,7 @@ RSpec.describe Sinatra::Capture do
|
|||
|
||||
shared_examples_for "a template language" do |engine|
|
||||
lang = engine
|
||||
if engine == :erubi || engine == :erubis
|
||||
if engine == :erubi
|
||||
lang = :erb
|
||||
end
|
||||
if engine == :hamlit
|
||||
|
@ -41,7 +41,6 @@ RSpec.describe Sinatra::Capture do
|
|||
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
|
||||
|
|
|
@ -91,7 +91,7 @@ RSpec.describe Sinatra::ContentFor do
|
|||
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
|
||||
|
|
|
@ -113,12 +113,3 @@ begin
|
|||
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
|
||||
|
|
Loading…
Reference in New Issue