Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 90df3ad289
Fetching contributors…

Cannot retrieve contributors at this time

22 lines (18 sloc) 0.431 kB
# Strongly encourages sinatra to render .erb files
# with the much-faster erubis library
module Sinatra::Erb
def erb(content, options={})
begin
require 'erubis'
@@erb_class = Erubis::Eruby
rescue LoadError
require "erb"
@@erb_class = ::ERB
end
render(:erb, content, options)
end
private
def render_erb(content, options = {})
@@erb_class.new(content).result(binding)
end
end
Jump to Line
Something went wrong with that request. Please try again.