lib/revs-utils.rb in revs-utils-2.0.8 vs lib/revs-utils.rb in revs-utils-2.0.9
- old
+ new
@@ -70,11 +70,11 @@
sources = Array.new
files.each do |file|
file.each do |row|
#Make sure the sourceid and filename are the same
fname = row[get_manifest_section(REGISTER)['filename']].chomp(File.extname(row[get_manifest_section(REGISTER)['filename']]))
- return false if row[get_manifest_section(REGISTER)['sourceid']] != fname
+ return false if ((row[get_manifest_section(REGISTER)['sourceid']] != fname) || ((/\s/ =~ row[get_manifest_section(REGISTER)['sourceid']].strip) != nil))
sources << row[get_manifest_section(REGISTER)['sourceid']]
end
end
return sources.uniq.size == sources.size
@@ -101,10 +101,10 @@
csv_data.each do |row|
get_manifest_section(REGISTER).keys.each do |header| # label should be there as a column but does not always need a value
return false if header.downcase !='label' && row[header].blank? #Alternatively consider row[header].class != String or row[header].size <= 0
end
fname = row[get_manifest_section(REGISTER)['filename']].chomp(File.extname(row[get_manifest_section(REGISTER)['filename']]))
- return false if row[get_manifest_section(REGISTER)['sourceid']] != fname
+ return false if ((row[get_manifest_section(REGISTER)['sourceid']] != fname) || ((/\s/ =~ row[get_manifest_section(REGISTER)['sourceid']].strip) != nil))
sources << row[get_manifest_section(REGISTER)['sourceid']]
end
return sources.uniq.size == sources.size
end