From 25f83221d46744848f4b6f2f6d64ad822abace80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Mon, 16 Jan 2012 15:11:34 +0100 Subject: Node: set ext! --- lib/zorglub/node.rb | 6 +++++- 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! -- cgit v1.1-2-g2b99