Skip to content

Commit

Permalink
small fix to data importer to ignore CSV header line
Browse files Browse the repository at this point in the history
  • Loading branch information
daddyz committed Aug 24, 2021
1 parent 0063e30 commit 563e524
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/phonelib/data_importer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def import_country_names
io = open('http://api.geonames.org/countryInfoCSV?username=demo&style=full')
csv = CSV.new(io, {col_sep: "\t"})
csv.each do |row|
next if row[0].nil? || row[0].start_with?('#') || row[0].empty?
next if row[0].nil? || row[0].start_with?('#') || row[0].empty? || row[0].size != 2

@countries[row[0]] = row[4]
end
Expand Down

0 comments on commit 563e524

Please sign in to comment.