From ed96103448dacfb2e3fb561e5a1c00275c2da741 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 3 Jan 2012 23:32:54 +0100 Subject: Node: do not accept empty engine, layout or view, do not return directory path --- lib/zorglub/node.rb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/zorglub/node.rb b/lib/zorglub/node.rb index 6cf0b20..5e66d1c 100644 --- a/lib/zorglub/node.rb +++ b/lib/zorglub/node.rb @@ -19,12 +19,12 @@ module Zorglub end # def engine engine=nil - @engine = engine unless engine.nil? + @engine = engine unless engine.nil? or engine.empty? @engine ||= Config.engine end # def layout layout=nil - @layout = layout unless layout.nil? + @layout = layout unless layout.nil? or layout.empty? @layout ||= Config.layout end # @@ -125,17 +125,19 @@ module Zorglub end # def engine engine=nil - @action[:engine] = engine unless engine.nil? + @action[:engine] = engine unless engine.nil? or engine.empty? @action[:engine] end # def layout layout=nil - @action[:layout] = layout unless layout.nil? + @action[:layout] = layout unless layout.nil? or layout.empty? + return '' if @action[:layout].nil? File.join(Config.layout_base_path, @action[:layout])+ Config.engine_ext(@action[:engine]) end # - def view path=nil - @action[:view] = path unless path.nil? + def view view=nil + @action[:view] = view unless view.nil? or view.empty? + return '' if @action[:view].nil? File.join(Config.view_base_path, @action[:view])+Config.engine_ext(@action[:engine]) end # -- cgit v1.1-2-g2b99