lib/bolt/serve.rb in benofsky-bolt-0.4.3 vs lib/bolt/serve.rb in benofsky-bolt-0.4.4
- old
+ new
@@ -75,14 +75,13 @@
# url => block references.
load_pages
parse_config
page_name = request['GET'].gsub(/\.html/,'')[1..-1]
+ page_name = "index" if page_name == ""
page = @pages[page_name]
- if(!page.nil?)
- page_name = "index" if page_name == ""
-
+ if(!page.nil?)
# A tad hacky, otherwise @current_page isn't set properly and all hell breaks loose
body = PageBinding.new(page_name).instance_eval(&page)
@server.reply(body)
elsif(File.exists?(d($config.resources) + request['GET']))
f = File.new(d($config.resources) + request['GET'])
\ No newline at end of file