diff --git a/CHANGELOG.md b/CHANGELOG.md index 854b0d4d..42fe517c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,8 @@ * Breaking change: Remove support for Mediawiki as a template engine. [#1791](https://github.com/sinatra/sinatra/pull/1791) by Eloy Pérez +* Breaking change: Remove support for Creole as a template engine. [#1792](https://github.com/sinatra/sinatra/pull/1792) 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 diff --git a/Gemfile b/Gemfile index 03ff03f6..78d01cbd 100644 --- a/Gemfile +++ b/Gemfile @@ -31,7 +31,6 @@ gem 'eventmachine' gem 'slim', '~> 4' gem 'rdoc' gem 'kramdown' -gem 'creole' gem 'markaby' gem 'radius' gem 'asciidoctor' diff --git a/README.de.md b/README.de.md index 2f72d439..36a61c43 100644 --- a/README.de.md +++ b/README.de.md @@ -61,7 +61,6 @@ diesen Server verwenden. - [Markaby Templates](#markaby-templates) - [RABL Templates](#rabl-templates) - [Slim Templates](#slim-templates) - - [Creole Templates](#creole-templates) - [Yajl Templates](#yajl-templates) - [Auf Variablen in Templates zugreifen](#auf-variablen-in-templates-zugreifen) - [Templates mit `yield` und verschachtelte Layouts](#templates-mit-yield-und-verschachtelte-layouts) @@ -850,44 +849,6 @@ Nimmt ebenso einen Block für Inline-Templates entgegen (siehe Beispiel). -#### Creole Templates - - - - - - - - - - - - - - -
Abhängigkeitcreole
Dateierweiterung.creole
Beispielcreole :wiki, :layout_engine => :erb
- -Da man aus dem Creole-Template heraus keine Ruby-Methoden aufrufen und auch -keine locals verwenden kann, wird man Creole üblicherweise in Kombination mit -anderen Renderern verwenden wollen: - -```ruby -erb :overview, :locals => { :text => creole(:einfuehrung) } -``` - -Beachte, dass man die `creole`-Methode auch aus anderen Templates heraus -aufrufen kann: - -```ruby -%h1 Gruß von Haml! -%p= creole(:Grüße) -``` - -Da man Ruby nicht von Creole heraus aufrufen kann, können auch Layouts -nicht in Creole geschrieben werden. Es ist aber möglich, einen Renderer -für die Templates zu verwenden und einen anderen für das Layout, indem -die `:layout_engine`-Option verwendet wird. - #### Yajl Templates diff --git a/README.es.md b/README.es.md index fc4636f9..b8093222 100644 --- a/README.es.md +++ b/README.es.md @@ -60,7 +60,6 @@ Se recomienda ejecutar `gem install puma`, porque Sinatra lo utilizará si está - [Plantillas Markaby](#plantillas-markaby) - [Plantillas RABL](#plantillas-rabl) - [Plantillas Slim](#plantillas-slim) - - [Plantillas Creole](#plantillas-creole) - [Plantillas Yajl](#plantillas-yajl) - [Accediendo a Variables en Plantillas](#accediendo-a-variables-en-plantillas) - [Plantillas con `yield` y `layout` anidado](#plantillas-con-yield-y-layout-anidado) @@ -858,42 +857,6 @@ También toma un bloque para plantillas inline (ver [ejemplo](#plantillas-inline
-#### Plantillas Creole - - - - - - - - - - - - - - -
DependenciasCreole
Extensiones de Archivo.creole
Ejemplocreole :wiki, :layout_engine => :erb
- -No es posible llamar métodos desde creole, ni pasarle locales. Por lo tanto, -generalmente va a usarlo en combinación con otro motor de renderizado: - -```ruby -erb :resumen, :locals => { :texto => cerole(:introduccion) } -``` - -Debe tomar en cuenta que también puede llamar al método `creole` desde otras -plantillas: - -```ruby -%h1 Hola Desde Haml! -%p= creole(:saludos) -``` - -Como no puedes utilizar Ruby desde Creole, no puedes usar layouts escritos en -Creole. De todos modos, es posible usar un motor de renderizado para el layout -distinto al de la plantilla pasando la opción `:layout_engine`. - #### Plantillas Yajl diff --git a/README.fr.md b/README.fr.md index 9c334a10..8118af0a 100644 --- a/README.fr.md +++ b/README.fr.md @@ -61,7 +61,6 @@ Sinatra utilise le server Thin quand il est disponible. - [Templates Markaby](#templates-markaby) - [Templates RABL](#templates-rabl) - [Templates Slim](#templates-slim) - - [Templates Creole](#templates-creole) - [Templates Yajl](#templates-yajl) - [Accéder aux variables dans un Template](#accéder-aux-variables-dans-un-template) - [Templates avec `yield` et layouts imbriqués](#templates-avec-yield-et-layouts-imbriqués) @@ -859,43 +858,6 @@ exemple).
-#### Templates Creole - - - - - - - - - - - - - - -
DépendancesCreole
Extensions de fichier.creole
Exemplecreole :wiki, :layout_engine => :erb
- -Il n'est pas possible d'appeler de méthodes Ruby depuis creole, ni de lui -passer de variables locales. Par conséquent, il sera souvent utilisé en -combinaison avec un autre moteur de rendu : - -```ruby -erb :accueil, :locals => { :text => markdown(:introduction) } -``` - -Notez que vous pouvez également appeler la méthode `creole` depuis un autre template : - -```ruby -%h1 Bonjour depuis Haml ! -%p= creole(:bienvenue) -``` - -Comme vous ne pouvez pas appeler de méthodes Ruby depuis Creole, vous ne pouvez -pas utiliser de layouts écrits en Creole. Toutefois, il est possible -d'utiliser un moteur de rendu différent pour le template et pour le layout -en utilisant l'option `:layout_engine`. - #### Templates Yajl diff --git a/README.ja.md b/README.ja.md index 61ae19c8..f2c81a78 100644 --- a/README.ja.md +++ b/README.ja.md @@ -58,7 +58,6 @@ PumaがあればSinatraはこれを利用するので、`gem install puma`する - [Markaby テンプレート](#markaby-テンプレート) - [RABL テンプレート](#rabl-テンプレート) - [Slim テンプレート](#slim-テンプレート) - - [Creole テンプレート](#creole-テンプレート) - [Yajl テンプレート](#yajl-テンプレート) - [テンプレート内での変数へのアクセス](#テンプレート内での変数へのアクセス) - [`yield`を伴うテンプレートとネストしたレイアウト](#yieldを伴うテンプレートとネストしたレイアウト) @@ -785,39 +784,6 @@ RadiusテンプレートからRubyのメソッドを直接呼び出すことが
-#### Creole テンプレート - - - - - - - - - - - - - - -
依存Creole
ファイル拡張子.creole
creole :wiki, :layout_engine => :erb
- -Creoleからメソッドを呼び出すことも、localsに変数を渡すこともできません。 -それゆえ、他のレンダリングエンジンとの組み合わせで使うのが普通です。 - -```ruby -erb :overview, :locals => { :text => creole(:introduction) } -``` - -ノート: 他のテンプレート内で`creole`メソッドを呼び出せます。 - -```ruby -%h1 Hello From Haml! -%p= creole(:greetings) -``` - -CreoleからはRubyを呼ぶことができないので、Creoleで書かれたレイアウトを使うことはできません。しかしながら、`:layout_engine`オプションを渡すことでテンプレートのものとは異なるレンダリングエンジンをレイアウトのために使うことができます。 - #### Yajl テンプレート diff --git a/README.ko.md b/README.ko.md index dc193eef..215db47c 100644 --- a/README.ko.md +++ b/README.ko.md @@ -56,7 +56,6 @@ thin이 설치되어 있을 경우 Sinatra는 thin을 통해 실행합니다. - [Markaby 템플릿](#markaby-템플릿) - [RABL 템플릿](#rabl-템플릿) - [Slim 템플릿](#slim-템플릿) - - [Creole 템플릿](#creole-템플릿) - [Yajl 템플릿](#yajl-템플릿) - [템플릿에서 변수에 접근하기](#템플릿에서-변수에-접근하기) - [템플릿에서의 `yield` 와 중첩 레이아웃](#템플릿에서의-yield-와-중첩-레이아웃) @@ -779,41 +778,6 @@ Radius 템플릿에서는 루비 메서드를 호출할 수 없기
-#### Creole 템플릿 - - - - - - - - - - - - - - -
의존성creole
파일 확장자.creole
예제creole :wiki, :layout_engine => :erb
- -Creole에서는 메서드 호출 뿐 아니라 locals 전달도 안됩니다. -따라서 일반적으로는 다른 렌더링 엔진과 함께 사용하게 됩니다. - -```ruby -erb :overview, :locals => { :text => creole(:introduction) } -``` - -다른 템플릿 속에서 `creole` 메서드를 호출할 수도 있습니다. - -```ruby -%h1 Hello From Haml! -%p= creole(:greetings) -``` - -Creole에서 루비를 호출할 수 없기 때문에, Creole으로 작성된 레이아웃은 -사용할 수 없습니다. 하지만, `:layout_engine` 옵션으로 레이아웃의 템플릿을 -다른 렌더링 엔진으로 렌더링 할 수는 있습니다. - #### Yajl 템플릿 diff --git a/README.malayalam.md b/README.malayalam.md index 371e23a2..10c99453 100644 --- a/README.malayalam.md +++ b/README.malayalam.md @@ -60,7 +60,6 @@ View at: [http://localhost:4567](http://localhost:4567) - [Markaby Templates](#markaby-templates) - [RABL Templates](#rabl-templates) - [Slim Templates](#slim-templates) - - [Creole Templates](#creole-templates) - [Yajl Templates](#yajl-templates) - [Accessing Variables in Templates](#accessing-variables-in-templates) - [Templates with `yield` and nested layouts](#templates-with-yield-and-nested-layouts) @@ -824,41 +823,6 @@ It also takes a block for inline templates (see [example](#inline-templates)).
-#### Creole Templates - - - - - - - - - - - - - - -
DependencyCreole
File Extension.creole
Examplecreole :wiki, :layout_engine => :erb
- -It is not possible to call methods from Creole, nor to pass locals to it. You -therefore will usually use it in combination with another rendering engine: - -```ruby -erb :overview, :locals => { :text => creole(:introduction) } -``` - -Note that you may also call the `creole` method from within other templates: - -```ruby -%h1 Hello From Haml! -%p= creole(:greetings) -``` - -Since you cannot call Ruby from Creole, you cannot use layouts written in -Creole. However, it is possible to use another rendering engine for the -template than for the layout by passing the `:layout_engine` option. - #### Yajl Templates diff --git a/README.md b/README.md index a898e202..01bd8c47 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,6 @@ pick up if available. - [Markaby Templates](#markaby-templates) - [RABL Templates](#rabl-templates) - [Slim Templates](#slim-templates) - - [Creole Templates](#creole-templates) - [Yajl Templates](#yajl-templates) - [Accessing Variables in Templates](#accessing-variables-in-templates) - [Templates with `yield` and nested layouts](#templates-with-yield-and-nested-layouts) @@ -851,41 +850,6 @@ It also takes a block for inline templates (see [example](#inline-templates)).
-#### Creole Templates - - - - - - - - - - - - - - -
DependencyCreole
File Extension.creole
Examplecreole :wiki, :layout_engine => :erb
- -It is not possible to call methods from Creole, nor to pass locals to it. You -therefore will usually use it in combination with another rendering engine: - -```ruby -erb :overview, :locals => { :text => creole(:introduction) } -``` - -Note that you may also call the `creole` method from within other templates: - -```ruby -%h1 Hello From Haml! -%p= creole(:greetings) -``` - -Since you cannot call Ruby from Creole, you cannot use layouts written in -Creole. However, it is possible to use another rendering engine for the -template than for the layout by passing the `:layout_engine` option. - #### Yajl Templates diff --git a/README.pl.md b/README.pl.md index 818f661a..eb58cee0 100644 --- a/README.pl.md +++ b/README.pl.md @@ -58,7 +58,6 @@ którego Sinatra użyje jeżeli będzie dostępny. - [Markaby Templates](#markaby-templates) - [RABL Templates](#rabl-templates) - [Slim Templates](#slim-templates) - - [Creole Templates](#creole-templates) - [Stylus Templates](#stylus-templates) - [Yajl Templates](#yajl-templates) - [Accessing Variables in Templates](#accessing-variables-in-templates) @@ -849,41 +848,6 @@ It also takes a block for inline templates (see [example](#inline-templates)).
-#### Creole Templates - - - - - - - - - - - - - - -
DependencyCreole
File Extension.creole
Examplecreole :wiki, :layout_engine => :erb
- -It is not possible to call methods from Creole, nor to pass locals to it. You -therefore will usually use it in combination with another rendering engine: - -```ruby -erb :overview, :locals => { :text => creole(:introduction) } -``` - -Note that you may also call the `creole` method from within other templates: - -```ruby -%h1 Hello From Haml! -%p= creole(:greetings) -``` - -Since you cannot call Ruby from Creole, you cannot use layouts written in -Creole. However, it is possible to use another rendering engine for the -template than for the layout by passing the `:layout_engine` option. - #### Stylus Templates diff --git a/README.pt-br.md b/README.pt-br.md index 9cc375d3..c790fa44 100644 --- a/README.pt-br.md +++ b/README.pt-br.md @@ -70,7 +70,6 @@ disponível, o Sinatra irá utilizá-la. - [Markaby Templates](#markaby-templates) - [RABL Templates](#rabl-templates) - [Slim Templates](#slim-templates) - - [Creole Templates](#creole-templates) - [Yajl Templates](#yajl-templates) - [Acessando Variáveis nos Templates](#acessando-variáveis-nos-templates) - [Templates com `yield` e layouts aninhados](#templates-com-yield-e-layouts-aninhados) @@ -898,42 +897,6 @@ Este também recebe um bloco para templates (veja o exemplo).
-#### Creole Templates - - - - - - - - - - - - - - -
DependênciaCreole
Extensão do Arquivo.creole
Exemplocreole :wiki, :layout_engine => :erb
- -Não é possível chamar métodos por este template, nem passar *locals* para o -mesmo. Portanto normalmente é utilizado junto a outra engine de renderização: - -```ruby -erb :overview, :locals => { :text => creole(:introduction) } -``` - -Note que você também pode chamar o método `creole` dentro de outros templates: - -```ruby -%h1 Olá do Haml! -%p= creole(:saudacoes) -``` - -Já que você não pode chamar o Ruby pelo Creole, você não -pode utilizar um layout escrito em Creole. Contudo é -possível utilizar outra engine de renderização como template, -deve-se passar a `:layout_engine` como opção. - #### Yajl Templates diff --git a/README.ru.md b/README.ru.md index 7b745d8b..75a25fd0 100644 --- a/README.ru.md +++ b/README.ru.md @@ -62,7 +62,6 @@ ruby myapp.rb - [Markaby шаблоны](#markaby-шаблоны) - [RABL шаблоны](#rabl-шаблоны) - [Slim шаблоны](#slim-шаблоны) - - [Creole шаблоны](#creole-шаблоны) - [Yajl шаблоны](#yajl-шаблоны) - [Доступ к переменным в шаблонах](#доступ-к-переменным-в-шаблонах) - [Шаблоны с `yield` и вложенные лэйауты](#шаблоны-с-yield-и-вложенные-лэйауты) @@ -855,43 +854,6 @@ erb :overview, :locals => { :text => rdoc(:introduction) }
-#### Creole шаблоны - - - - - - - - - - - - - - -
ЗависимостиCreole
Расширения файлов.creole
Примерcreole :wiki, :layout_engine => :erb
- -В Creole невозможно вызывать методы или передавать локальные переменные. -Следовательно, вам, скорее всего, придётся использовать данный шаблон совместно -с другим шаблонизатором: - -```ruby -erb :overview, :locals => { :text => creole(:introduction) } -``` - -обратите внимание на то, что вы можете вызывать метод `creole` из других шаблонов: - -```ruby -%h1 Hello From Haml! -%p= creole(:greetings) -``` - -Вы не можете вызывать Ruby код из Creole, соответственно вы не можете -использовать лэйауты на Creole. Тем не менее, существует возможность использовать -один шаблонизатор для отображения шаблона, а другой для лэйаута при помощи -опции `:layout_engine`. - #### Yajl шаблоны diff --git a/README.zh.md b/README.zh.md index 3e6746ba..9b4f1aee 100644 --- a/README.zh.md +++ b/README.zh.md @@ -55,7 +55,6 @@ ruby myapp.rb - [Markaby 模板](#markaby-模板) - [RABL 模板](#rabl-模板) - [Slim 模板](#slim-模板) - - [Creole 模板](#creole-模板) - [Yajl 模板](#yajl-模板) - [在模板中访问变量](#在模板中访问变量) - [带 `yield` 的模板和嵌套布局](#带-yield-的模板和嵌套布局) @@ -787,40 +786,6 @@ erb :overview, :locals => { :text => rdoc(:introduction) }
-#### Creole 模板 - - - - - - - - - - - - - - -
依赖项Creole
文件扩展名.creole
例子creole :wiki, :layout_engine => :erb
- -不能在 creole 中调用 Ruby 方法,也不能传递 locals 对象给它。 -因此你一般会结合其它的渲染引擎来使用它: - -```ruby -erb :overview, :locals => { :text => creole(:introduction) } -``` - -注意你也可以在其它模板内调用 `creole` 方法: - -```ruby -%h1 Hello From Haml! -%p= creole(:greetings) -``` - -因为不能在 Creole 模板文件内调用 Ruby 方法,你不能用 Creole 书写布局文件。 -然而,使用其它渲染引擎作为模版的布局是可能的,这需要通过传递 `:layout_engine` 选项。 - #### Yajl 模板 diff --git a/lib/sinatra/base.rb b/lib/sinatra/base.rb index 97c6b2c5..727ea68f 100644 --- a/lib/sinatra/base.rb +++ b/lib/sinatra/base.rb @@ -750,10 +750,6 @@ module Sinatra render(:slim, template, options, locals, &block) end - def creole(template, options = {}, locals = {}) - render :creole, template, options, locals - end - def yajl(template, options = {}, locals = {}) options[:default_content_type] = :json render :yajl, template, options, locals diff --git a/sinatra-contrib/lib/sinatra/engine_tracking.rb b/sinatra-contrib/lib/sinatra/engine_tracking.rb index e2a74d78..c1432239 100644 --- a/sinatra-contrib/lib/sinatra/engine_tracking.rb +++ b/sinatra-contrib/lib/sinatra/engine_tracking.rb @@ -65,11 +65,6 @@ module Sinatra @current_engine == :slim end - # @return [Boolean] Returns true if current engine is `:creole`. - def creole? - @current_engine == :creole - end - # @return [Boolean] Returns true if current engine is `:ruby`. def ruby? @current_engine == :ruby diff --git a/sinatra-contrib/lib/sinatra/namespace.rb b/sinatra-contrib/lib/sinatra/namespace.rb index 12bd42c3..5ff90b9e 100644 --- a/sinatra-contrib/lib/sinatra/namespace.rb +++ b/sinatra-contrib/lib/sinatra/namespace.rb @@ -227,7 +227,7 @@ module Sinatra ALLOWED_ENGINES = [ :erb, :erubi, :haml, :hamlit, :builder, :nokogiri, :liquid, :markdown, :rdoc, :asciidoc, :radius, :markaby, - :rabl, :slim, :creole, :yajl + :rabl, :slim, :yajl ] def self.prefixed(*names) diff --git a/sinatra-contrib/sinatra-contrib.gemspec b/sinatra-contrib/sinatra-contrib.gemspec index e791a122..b3854f80 100644 --- a/sinatra-contrib/sinatra-contrib.gemspec +++ b/sinatra-contrib/sinatra-contrib.gemspec @@ -52,7 +52,6 @@ EOF s.add_development_dependency "asciidoctor" s.add_development_dependency "radius" s.add_development_dependency "nokogiri" - s.add_development_dependency "creole" s.add_development_dependency "markaby" s.add_development_dependency "rake", "< 11" s.add_development_dependency "rack-test", "< 2" diff --git a/test/creole_test.rb b/test/creole_test.rb deleted file mode 100644 index ce4aa44a..00000000 --- a/test/creole_test.rb +++ /dev/null @@ -1,65 +0,0 @@ -require File.expand_path('helper', __dir__) - -begin -require 'creole' - -class CreoleTest < Minitest::Test - def creole_app(&block) - mock_app do - set :views, __dir__ + '/views' - get('/', &block) - end - get '/' - end - - it 'renders inline creole strings' do - creole_app { creole '= Hiya' } - assert ok? - assert_body "

Hiya

" - end - - it 'renders .creole files in views path' do - creole_app { creole :hello } - assert ok? - assert_body "

Hello From Creole

" - end - - it "raises error if template not found" do - mock_app { get('/') { creole :no_such_template } } - assert_raises(Errno::ENOENT) { get('/') } - end - - it "renders with inline layouts" do - mock_app do - layout { 'THIS. IS. #{yield.upcase}!' } - get('/') { creole 'Sparta', :layout_engine => :str } - end - get '/' - assert ok? - assert_like 'THIS. IS.

SPARTA

!', body - end - - it "renders with file layouts" do - creole_app do - creole 'Hello World', :layout => :layout2, :layout_engine => :erb - end - assert ok? - assert_body "ERB Layout!\n

Hello World

" - end - - it "can be used in a nested fashion for partials and whatnot" do - mock_app do - template(:inner) { "hi" } - template(:outer) { "<%= creole :inner %>" } - get('/') { erb :outer } - end - - get '/' - assert ok? - assert_like '

hi

', body - end -end - -rescue LoadError - warn "#{$!}: skipping creole tests" -end diff --git a/test/views/hello.creole b/test/views/hello.creole deleted file mode 100644 index 50db5f85..00000000 --- a/test/views/hello.creole +++ /dev/null @@ -1 +0,0 @@ -= Hello From Creole