From 6b2c44794b8aeeca96a9b3114b87b3c1df69fd9d Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 1 Oct 2012 15:43:19 -0400 Subject: v3: cosmetic code, .is_a?(X) replaces .class==X (& some defined? & nil? tests) --- lib/sisu/v3/po4a.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/sisu/v3/po4a.rb') diff --git a/lib/sisu/v3/po4a.rb b/lib/sisu/v3/po4a.rb index 7ce825ee..53bab960 100644 --- a/lib/sisu/v3/po4a.rb +++ b/lib/sisu/v3/po4a.rb @@ -214,7 +214,7 @@ module SiSU_Po4a end desc="#{d}#{s_mark}#{instruct}" orig=(orig_notes[i].to_s =~/^\^~[\d*+]+/) ? (orig_notes[i].to_s.gsub(/^\^~[\d*+]+/,'^~')) : orig_notes[i].to_s - trans=if trn_notes.class==Array \ + trans=if trn_notes.is_a?(Array) \ and trn_notes.length==orig_notes.length (trn_notes[i].to_s =~/^\^~[\d*+]+/) ? (trn_notes[i].to_s.gsub(/^\^~[\d*+]+/,'^~')) : trn_notes[i].to_s else '' @@ -749,12 +749,12 @@ GSUB #next if data_trn[t].is == :comment end end - if (defined? data_src[s].ocn and data_src[s].ocn.class == Fixnum) \ - and (defined? data_trn[t].ocn and data_trn[t].ocn.class == Fixnum) \ + if (defined? data_src[s].ocn and data_src[s].ocn.is_a?(Fixnum)) \ + and (defined? data_trn[t].ocn and data_trn[t].ocn.is_a?(Fixnum)) \ and (data_src[s].ocn == data_trn[t].ocn) @m_s,@m_t=s,t - elsif (defined? data_src[s].ocn and data_src[s].ocn.class == Fixnum) \ - and (defined? data_trn[t].ocn and data_trn[t].ocn.class == Fixnum) \ + elsif (defined? data_src[s].ocn and data_src[s].ocn.is_a?(Fixnum)) \ + and (defined? data_trn[t].ocn and data_trn[t].ocn.is_a?(Fixnum)) \ and (data_src[s].ocn != data_trn[t].ocn) p '--- OCN ---' p 'mis-match' @@ -934,7 +934,7 @@ GSUB @sisu=[] emptyline=0 @content.each do |para| # this is a hack - if para.class==Array \ + if para.is_a?(Array) \ and para.length > 0 para.each do |line| if line -- cgit v1.2.3