diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2012-01-03 23:32:54 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2012-01-03 23:32:54 +0100 |
commit | ed96103448dacfb2e3fb561e5a1c00275c2da741 (patch) | |
tree | b64ae4e4700fb8b1cd09b08aae1d7a5e45e162af /lib | |
parent | 642da3156e03049ceae1e16d01f1c36457c59542 (diff) | |
download | zorglub-ed96103448dacfb2e3fb561e5a1c00275c2da741.zip zorglub-ed96103448dacfb2e3fb561e5a1c00275c2da741.tar.gz |
Node: do not accept empty engine, layout or view, do not return directory path
Diffstat (limited to 'lib')
-rw-r--r-- | lib/zorglub/node.rb | 14 |
1 files 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 # |