aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v3/po4a.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2012-10-01 15:43:19 -0400
committerRalph Amissah <ralph@amissah.com>2012-10-01 15:43:19 -0400
commit6b2c44794b8aeeca96a9b3114b87b3c1df69fd9d (patch)
tree20ffa7c21eda17b340e473733088fa80986cc0d6 /lib/sisu/v3/po4a.rb
parentv3: 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/po4a.rb')
-rw-r--r--lib/sisu/v3/po4a.rb12
1 files changed, 6 insertions, 6 deletions
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