aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v4/dal.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2012-12-28 12:31:04 -0500
committerRalph Amissah <ralph@amissah.com>2012-12-28 12:31:04 -0500
commite791dbbdd0097b6bba0829000408ab30d0810fbe (patch)
treebb5a341e757b38f9335ce2c8aa2884e28facdb39 /lib/sisu/v4/dal.rb
parentv4: sisu: --color flag, which toggles color on/off (Closes: #622171) (diff)
v4 v3: largely cosmetic
Diffstat (limited to 'lib/sisu/v4/dal.rb')
-rw-r--r--lib/sisu/v4/dal.rb56
1 files changed, 24 insertions, 32 deletions
diff --git a/lib/sisu/v4/dal.rb b/lib/sisu/v4/dal.rb
index 0e816091..1fa0ecb9 100644
--- a/lib/sisu/v4/dal.rb
+++ b/lib/sisu/v4/dal.rb
@@ -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