aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--data/doc/sisu/CHANGELOG_v52
-rw-r--r--lib/sisu/v5/sysenv.rb59
2 files changed, 31 insertions, 30 deletions
diff --git a/data/doc/sisu/CHANGELOG_v5 b/data/doc/sisu/CHANGELOG_v5
index d38cefc1..5d53be74 100644
--- a/data/doc/sisu/CHANGELOG_v5
+++ b/data/doc/sisu/CHANGELOG_v5
@@ -30,6 +30,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_5.0.9.orig.tar.xz
sisu_5.0.9.orig.tar.xz
sisu_5.0.9-1.dsc
+* output structure by :filename or :filetype, multilingual default, fix
+
%% 5.0.8.orig.tar.xz (2013-07-30:30/2)
http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/sisu_5.0.8
http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/debian/sisu_5.0.8-1
diff --git a/lib/sisu/v5/sysenv.rb b/lib/sisu/v5/sysenv.rb
index 9ddc763e..5ea84832 100644
--- a/lib/sisu/v5/sysenv.rb
+++ b/lib/sisu/v5/sysenv.rb
@@ -442,8 +442,9 @@ module SiSU_Env
@fnn,@fnb,@fnt,@flv,@fnz=@@fnn,@@fnb,@@fnt,@@flv,@@fnz
end
def default_language?
- if @rc
- if defined? @rc['language_default'] \
+ if @rc \
+ && defined? @rc['language_default']
+ if (@rc['language_default'].is_a?(String)) \
&& (@rc['language_default'] =~/#{Px[:lng_lst_rgx]}/)
@rc['language_default']
else
@@ -454,11 +455,12 @@ module SiSU_Env
end
end
def mono_multi_lingual?
- if @rc
- if defined? @rc['lingual'] \
+ if @rc \
+ && defined? @rc['lingual']
+ if (@rc['lingual'].is_a?(String)) \
&& (@rc['lingual'] =~/mono(?:lingual)?/)
:mono
- elsif defined? @rc['lingual'] \
+ elsif (@rc['lingual'].is_a?(String)) \
&& (@rc['lingual'] =~/multi(?:lingual)?/)
:multi
else
@@ -470,31 +472,28 @@ module SiSU_Env
def output_dir_structure
def by?
output_structure=:filename #set default output structure
- if @rc
- output_structure=if defined? @rc['output_dir_structure_by']
- output_structure=if (@rc['output_dir_structure_by'] =~/dump/) \
- or ((defined? @rc['output_structure']['dump']) \
- && @rc['output_structure']['dump'] ==true)
- :dump
- elsif (@rc['output_dir_structure_by'] =~/redirect/) \
- or ((defined? @rc['output_structure']['redirect']) \
- && @rc['output_structure']['redirect'] ==true)
- :redirect
- elsif (@rc['output_dir_structure_by'] =~/language/) \
- or ((defined? @rc['output_structure']['by_language']) \
- && @rc['output_structure']['by_language'] ==true)
- :language
- elsif (@rc['output_dir_structure_by'] =~/filetype/) \
- or ((defined? @rc['output_structure']['by_filetype']) \
- && @rc['output_structure']['by_filetype'] ==true)
- :filetype
- elsif (@rc['output_dir_structure_by'] =~/filename/) \
- or ((defined? @rc['output_structure']['by_filename']) \
- && @rc['output_structure']['by_filename'] ==true)
- :filename
- else #set default
- :language
- end
+ if @rc \
+ && defined? @rc['output_dir_structure_by']
+ output_structure=if (@rc['output_dir_structure_by'] =~/dump/) \
+ or ((defined? @rc['output_structure']['dump']) \
+ && @rc['output_structure']['dump'] ==true)
+ :dump
+ elsif (@rc['output_dir_structure_by'] =~/redirect/) \
+ or ((defined? @rc['output_structure']['redirect']) \
+ && @rc['output_structure']['redirect'] ==true)
+ :redirect
+ elsif (@rc['output_dir_structure_by'] =~/language/) \
+ or ((defined? @rc['output_structure']['by_language']) \
+ && @rc['output_structure']['by_language'] ==true)
+ :language
+ elsif (@rc['output_dir_structure_by'] =~/filetype/) \
+ or ((defined? @rc['output_structure']['by_filetype']) \
+ && @rc['output_structure']['by_filetype'] ==true)
+ :filetype
+ elsif (@rc['output_dir_structure_by'] =~/filename/) \
+ or ((defined? @rc['output_structure']['by_filename']) \
+ && @rc['output_structure']['by_filename'] ==true)
+ :filename
else #set default
:language
end