From eee3d11a9a6518ddba74a486c3a3b6e4569407ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 3 Jan 2012 17:23:18 +0100 Subject: config: simpify #view_base_path and #layout_base_path --- lib/zorglub/config.rb | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/lib/zorglub/config.rb b/lib/zorglub/config.rb index 44574a9..e4804fd 100644 --- a/lib/zorglub/config.rb +++ b/lib/zorglub/config.rb @@ -23,19 +23,13 @@ module Zorglub end # def view_base_path - if @options.has_key? :view_path - @options[:view_path] - else - File.join @options[:root], @options[:view_dir] - end + p = @options[:view_path] + ( p.nil? ? File.join(@options[:root], @options[:view_dir]) : p ) end # def layout_base_path - if @options.has_key? :layout_path - @options[:layout_path] - else - File.join @options[:root], @options[:layout_dir] - end + p = @options[:layout_path] + ( p.nil? ? File.join(@options[:root], @options[:layout_dir]) : p ) end # def register_engine name, ext, proc -- cgit v1.1-2-g2b99