diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2012-01-16 15:11:34 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2012-01-16 15:11:34 +0100 |
commit | 25f83221d46744848f4b6f2f6d64ad822abace80 (patch) | |
tree | 9ae3d373014e0735a27bf946884bc1574e1e9a1e | |
parent | c3a3d77f9c6995fcc1f1c33ad9935aaa3ec39987 (diff) | |
download | zorglub-25f83221d46744848f4b6f2f6d64ad822abace80.zip zorglub-25f83221d46744848f4b6f2f6d64ad822abace80.tar.gz |
Node: set ext!
-rw-r--r-- | lib/zorglub/node.rb | 6 | ||||
-rw-r--r-- | spec/spec_helper.rb | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/lib/zorglub/node.rb b/lib/zorglub/node.rb index 980398d..6af39d1 100644 --- a/lib/zorglub/node.rb +++ b/lib/zorglub/node.rb @@ -226,7 +226,7 @@ module Zorglub File.join(Config.view_base_path, @options[:view])+ext end # - def ext ext=nil + def ext! ext if ext.nil? or ext.empty? @options[:ext]||'' else @@ -234,6 +234,10 @@ module Zorglub end end # + def ext + @options[:ext]||'' + end + # def inherited_var sym, *args d = self.class.inherited_vars[sym].clone || [] unless args.empty? diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 18c057c..6a71ef4 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -73,12 +73,12 @@ class Node0 < Zorglub::Node def xml_file no_layout! engine! :file - ext 'xml' + ext! 'xml' end def plain_file no_layout! engine! :file - ext 'txt' + ext! 'txt' end def engines name no_layout! |