diff options
author | Ralph Amissah <ralph@amissah.com> | 2012-10-01 15:43:19 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2012-10-01 15:43:19 -0400 |
commit | 6b2c44794b8aeeca96a9b3114b87b3c1df69fd9d (patch) | |
tree | 20ffa7c21eda17b340e473733088fa80986cc0d6 /lib/sisu/v3/dal.rb | |
parent | v3: cosmetic code, if true ; x, remove semicolons replace with "then" (diff) |
v3: cosmetic code, .is_a?(X) replaces .class==X (& some defined? & nil? tests)
Diffstat (limited to 'lib/sisu/v3/dal.rb')
-rw-r--r-- | lib/sisu/v3/dal.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/sisu/v3/dal.rb b/lib/sisu/v3/dal.rb index 79e12e2d..a03ed55c 100644 --- a/lib/sisu/v3/dal.rb +++ b/lib/sisu/v3/dal.rb @@ -445,18 +445,18 @@ module SiSU_DAL end def make_marshal_content marshal_dal=@make.marshal.dal_content - File.open(marshal_dal,'w'){|f| Marshal.dump(@data,f)} if @data.class==Array + File.open(marshal_dal,'w'){|f| Marshal.dump(@data,f)} if @data.is_a?(Array) end def make_marshal_metadata marshal_dal=@make.marshal.dal_metadata - File.open(marshal_dal,'w'){|f| Marshal.dump(@data,f)} if @data.class==Array + File.open(marshal_dal,'w'){|f| Marshal.dump(@data,f)} if @data.is_a?(Array) end def idx_html_hard_output if @md.book_idx \ and @md.opt.cmd =~/M/ filename_meta=@cf.file_meta_idx_html - unless @data.nil? #REMOVE earliest possible - @data.each {|s| p s.inspect + "\n" unless s.class==String} + if @data.is_a?(Array) + @data.each {|s| p s.inspect + "\n" unless s.is_a?(String)} @data.each {|s| filename_meta.puts s.strip + "\n" unless s.strip.empty?} end else @@ -466,27 +466,27 @@ module SiSU_DAL end def make_marshal_idx_sst_html_seg marshal_dal=@make.marshal.dal_idx_sst_rel_html_seg - File.open(marshal_dal,'w'){|f| Marshal.dump(@data,f)} if @data.class==Array + File.open(marshal_dal,'w'){|f| Marshal.dump(@data,f)} if @data.is_a?(Array) end def make_marshal_idx_sst_rel marshal_dal=@make.marshal.dal_idx_sst_rel - File.open(marshal_dal,'w'){|f| Marshal.dump(@data,f)} if @data.class==Array + File.open(marshal_dal,'w'){|f| Marshal.dump(@data,f)} if @data.is_a?(Array) end def make_marshal_idx_html marshal_dal=@make.marshal.dal_idx_html - File.open(marshal_dal,'w'){|f| Marshal.dump(@data,f)} if @data.class==Array + File.open(marshal_dal,'w'){|f| Marshal.dump(@data,f)} if @data.is_a?(Array) end def make_marshal_idx_xhtml marshal_dal=@make.marshal.dal_idx_xhtml - File.open(marshal_dal,'w'){|f| Marshal.dump(@data,f)} if @data.class==Array + File.open(marshal_dal,'w'){|f| Marshal.dump(@data,f)} if @data.is_a?(Array) end def make_marshal_map_nametags marshal_dal=@make.marshal.dal_map_nametags - File.open(marshal_dal,'w'){|f| Marshal.dump(@data,f)} if @data.class==Hash + File.open(marshal_dal,'w'){|f| Marshal.dump(@data,f)} if @data.is_a?(Hash) end def make_marshal_map_name_ocn_htmlseg marshal_dal=@make.marshal.dal_map_ocn_htmlseg - File.open(marshal_dal,'w'){|f| Marshal.dump(@data,f)} if @data.class==Hash + File.open(marshal_dal,'w'){|f| Marshal.dump(@data,f)} if @data.is_a?(Hash) end end class Make |