Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 21e045bb97
Fetching contributors…

Cannot retrieve contributors at this time

25 lines (21 sloc) 0.524 kB
require 'rabl'
require 'tilt'
module Gon
module Sinatra
module Rabl
class << self
def cache
@cache ||= Tilt::Cache.new
end
def parse_rabl(rabl_path, controller)
source = cache.fetch(rabl_path) do
File.read(rabl_path)
end
rabl_engine = ::Rabl::Engine.new(source, :format => 'json')
output = rabl_engine.render(controller, {})
::Rabl.configuration.json_engine.decode(output)
end
end
end
end
end
Jump to Line
Something went wrong with that request. Please try again.