diff options
author | Ralph Amissah <ralph@amissah.com> | 2013-01-05 21:53:52 -0500 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2013-01-05 21:53:52 -0500 |
commit | 65adfcc0343ed43c5c646d9fc8707f5e4ba8e477 (patch) | |
tree | 237703d730f222e9e42cb03259eac32c6c81b34f /lib/sisu/v3/dal.rb | |
parent | debian/changelog (4.0.0-1) [posted to experimental, awaiting Wheezy freeze end] (diff) | |
parent | date 2013: version & changelog; headers bin/sisu & lib/; code constants.rb (diff) |
Merge tag 'sisu_4.0.1' into debian/sid
Diffstat (limited to 'lib/sisu/v3/dal.rb')
-rw-r--r-- | lib/sisu/v3/dal.rb | 58 |
1 files changed, 25 insertions, 33 deletions
diff --git a/lib/sisu/v3/dal.rb b/lib/sisu/v3/dal.rb index 0e816091..fa3261ab 100644 --- a/lib/sisu/v3/dal.rb +++ b/lib/sisu/v3/dal.rb @@ -8,7 +8,7 @@ * Author: Ralph Amissah * Copyright: (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, - 2007, 2008, 2009, 2010, 2011, 2012 Ralph Amissah, All Rights Reserved. + 2007, 2008, 2009, 2010, 2011, 2012, 2013 Ralph Amissah, All Rights Reserved. * License: GPL 3 or later: @@ -287,59 +287,51 @@ module SiSU_DAL end def read_fnm dal=[] - dal=if FileTest.file?(@fnm) - File.open(@fnm,'r:utf-8'){ |f| dal=Marshal.load(f)} - else SiSU_DAL::Source.new(@opt).create_dal - end + dal=(FileTest.file?(@fnm)) \ + ? (File.open(@fnm,'r:utf-8'){ |f| dal=Marshal.load(f)}) + : SiSU_DAL::Source.new(@opt).create_dal end def read_fnc dal=[] - dal=if FileTest.file?(@fnc) - File.open(@fnc,'r:utf-8'){ |f| dal=Marshal.load(f)} - else SiSU_DAL::Source.new(@opt).create_dal - end + dal=(FileTest.file?(@fnc)) \ + ? (File.open(@fnc,'r:utf-8'){ |f| dal=Marshal.load(f)}) + : SiSU_DAL::Source.new(@opt).create_dal end def read_idx_sst m=[] - m=if FileTest.file?(@idx_sst) - File.open(@idx_sst,'r:utf-8'){ |f| m=Marshal.load(f)} - else nil - end + m=(FileTest.file?(@idx_sst)) \ + ? (File.open(@idx_sst,'r:utf-8'){ |f| m=Marshal.load(f)}) + : nil end def read_idx_raw m=[] - m=if FileTest.file?(@idx_raw) - File.open(@idx_raw,'r:utf-8'){ |f| m=Marshal.load(f)} - else nil - end + m=(FileTest.file?(@idx_raw)) \ + ? (File.open(@idx_raw,'r:utf-8'){ |f| m=Marshal.load(f)}) + : nil end def read_idx_html m=[] - m=if FileTest.file?(@idx_html) - File.open(@idx_html,'r:utf-8'){ |f| m=Marshal.load(f)} - else nil - end + m=(FileTest.file?(@idx_html)) \ + ? (File.open(@idx_html,'r:utf-8'){ |f| m=Marshal.load(f)}) + : nil end def read_idx_xhtml m=[] - m=if FileTest.file?(@idx_xhtml) - File.open(@idx_xhtml,'r:utf-8'){ |f| m=Marshal.load(f)} - else nil - end + m=(FileTest.file?(@idx_xhtml)) \ + ? (File.open(@idx_xhtml,'r:utf-8'){ |f| m=Marshal.load(f)}) + : nil end def read_map_nametags m=[] - m=if FileTest.file?(@map_nametags) - File.open(@map_nametags,'r:utf-8'){ |f| m=Marshal.load(f)} - else nil - end + m=(FileTest.file?(@map_nametags)) \ + ? (File.open(@map_nametags,'r:utf-8'){ |f| m=Marshal.load(f)}) + : nil end def read_map_ocn_htmlseg m=[] - m=if FileTest.file?(@map_ocn_htmlseg) - File.open(@map_ocn_htmlseg,'r:utf-8'){ |f| m=Marshal.load(f)} - else nil - end + m=(FileTest.file?(@map_ocn_htmlseg)) \ + ? (File.open(@map_ocn_htmlseg,'r:utf-8'){ |f| m=Marshal.load(f)}) + : nil end end class Output |