Skip to content

Commit

Permalink
deprecate #erubis
Browse files Browse the repository at this point in the history
  • Loading branch information
rkh committed Apr 14, 2011
1 parent 9b94ee6 commit 3e641db
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 122 deletions.
24 changes: 0 additions & 24 deletions README.rdoc
Expand Up @@ -256,30 +256,6 @@ and overridden on an individual basis.

Renders <tt>./views/index.erb</tt>.

=== Erubis Templates

The <tt>erubis</tt> gem/library is required to render Erubis templates:

# You'll need to require erubis in your app
require 'erubis'

get '/' do
erubis :index
end

Renders <tt>./views/index.erubis</tt>.

It is also possible to replace Erb with Erubis:

require 'erubis'
Tilt.register :erb, Tilt[:erubis]

get '/' do
erb :index
end

Renders <tt>./views/index.erb</tt> with Erubis.

=== Builder Templates

The <tt>builder</tt> gem/library is required to render builder templates:
Expand Down
2 changes: 2 additions & 0 deletions lib/sinatra/base.rb
Expand Up @@ -451,6 +451,8 @@ def erb(template, options={}, locals={})
end

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

Expand Down
4 changes: 0 additions & 4 deletions sinatra.gemspec
Expand Up @@ -44,7 +44,6 @@ Gem::Specification.new do |s|
test/delegator_test.rb
test/encoding_test.rb
test/erb_test.rb
test/erubis_test.rb
test/extensions_test.rb
test/filter_test.rb
test/haml_test.rb
Expand Down Expand Up @@ -80,15 +79,13 @@ Gem::Specification.new do |s|
test/views/calc.html.erb
test/views/error.builder
test/views/error.erb
test/views/error.erubis
test/views/error.haml
test/views/error.sass
test/views/explicitly_nested.str
test/views/foo/hello.test
test/views/hello.builder
test/views/hello.coffee
test/views/hello.erb
test/views/hello.erubis
test/views/hello.haml
test/views/hello.less
test/views/hello.liquid
Expand All @@ -105,7 +102,6 @@ Gem::Specification.new do |s|
test/views/hello.textile
test/views/layout2.builder
test/views/layout2.erb
test/views/layout2.erubis
test/views/layout2.haml
test/views/layout2.liquid
test/views/layout2.mab
Expand Down
88 changes: 0 additions & 88 deletions test/erubis_test.rb

This file was deleted.

3 changes: 0 additions & 3 deletions test/views/error.erubis

This file was deleted.

1 change: 0 additions & 1 deletion test/views/hello.erubis

This file was deleted.

2 changes: 0 additions & 2 deletions test/views/layout2.erubis

This file was deleted.

0 comments on commit 3e641db

Please sign in to comment.