lib/servel/app.rb in servel-0.9.0 vs lib/servel/app.rb in servel-0.10.0
- old
+ new
@@ -16,25 +16,18 @@
return redirect("#{url_root}#{url_path}/") unless env["PATH_INFO"].end_with?("/")
return [404, {}, []] unless fs_path.exist?
- index(Servel::Locals.new(url_root: url_root, url_path: url_path, fs_path: fs_path))
+ Servel::Index.new(url_root: url_root, url_path: url_path, fs_path: fs_path).render
end
def redirect(location)
[302, { "Location" => location }, []]
end
def clean_url_path(path)
url_path = Rack::Utils.unescape_path(path)
raise unless Rack::Utils.valid_path?(url_path)
Rack::Utils.clean_path_info(url_path)
- end
-
- def index(locals)
- @haml_context ||= Servel::HamlContext.new
- body = @haml_context.render('index.haml', locals.resolve)
-
- [200, {}, [body]]
end
end
\ No newline at end of file