revs-utils 2.1.23 → 2.1.24

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3e2e374ef99a87e7697017ce89cf6198e65467f8
4
- data.tar.gz: 9eeddf78e4bebd81409cab362ae1e9b6098eb28b
3
+ metadata.gz: bd5c3129b58d2c793521ac3b8bc72f40ff57b00b
4
+ data.tar.gz: d867f58ece64fb935d0fa7340f54bbe73954f289
5
5
  SHA512:
6
- metadata.gz: f650162f83787ae324f4da0be2aa316cab7689d7cc2c76ca47a2d3e6f1af5c17271fc6d04e1a5b541352f9c817b7c3bc25887a434e2f9f0891be760ce13dc2e3
7
- data.tar.gz: 83c18367612b11cf48fdd340aa2faf61b5a1035447dbea2eb20e9689a8b4ead013ee2c8203c50e8e3a5e951b8fe6e2eda9e9be15e4904e7e57d3974066c7b295
6
+ metadata.gz: 6000156706af2e0acaaf05e0aff21bfe370eccd0df87844a34b56ee3d32b41ffebd889c77c3a4d1c9fe0dac29b625dffb949b72a2114180dd5fed84bceb5583d
7
+ data.tar.gz: bcaa1bbae4ca854629af114c0665655721e26a4a52b0209e34a0b0cefa1d352f48a02b41ccf30f8767e5e6fdf77a9cd974557f6bef503a19fc794c4c2e6ce884
@@ -1,5 +1,5 @@
1
1
  module Revs
2
2
  module Utils
3
- VERSION = "2.1.23"
3
+ VERSION = "2.1.24"
4
4
  end
5
5
  end
data/lib/revs-utils.rb CHANGED
@@ -188,16 +188,16 @@ module Revs
188
188
  end
189
189
  sources=Array.new
190
190
  #Make sure all files have entries for those required headers
191
- csv_data.each do |row|
191
+ csv_data.each_with_index do |row,i|
192
192
  get_manifest_section(REGISTER).keys.each do |header| # label should be there as a column but does not always need a value
193
193
  if header.downcase !='label' && row[header].blank?
194
- puts "#{row[get_manifest_section(REGISTER)['sourceid']]} does not have a value for a required registration field"
194
+ puts "Row #{i}: #{row[get_manifest_section(REGISTER)['sourceid']]} does not have a value for a required registration field"
195
195
  result2=false
196
196
  end
197
197
  end
198
198
  fname = row[get_manifest_section(REGISTER)['filename']].chomp(File.extname(row[get_manifest_section(REGISTER)['filename']]))
199
199
  if ((row[get_manifest_section(REGISTER)['sourceid']] != fname) || ((/\s/ =~ row[get_manifest_section(REGISTER)['sourceid']].strip) != nil))
200
- puts "#{row[get_manifest_section(REGISTER)['sourceid']]} does not match the filename or has a space in it"
200
+ puts "Row #{i}: #{row[get_manifest_section(REGISTER)['sourceid']]} does not match the filename or has a space in it"
201
201
  result3=false
202
202
  end
203
203
  sources << row[get_manifest_section(REGISTER)['sourceid']]
@@ -214,12 +214,12 @@ module Revs
214
214
  # looks at certain metadata fields in manifest to confirm validity (such as dates and formats)
215
215
  def check_metadata(csv_data)
216
216
  bad_rows=0
217
- csv_data.each do |row|
217
+ csv_data.each_with_index do |row,i|
218
218
  valid_date=revs_is_valid_datestring?(row[get_manifest_section(METADATA)['year']] || row[get_manifest_section(METADATA)['date']])
219
219
  valid_format=revs_is_valid_format?(row[get_manifest_section(METADATA)['format']])
220
220
  unless (valid_date && valid_format)
221
221
  bad_rows+=1
222
- puts "#{row[get_manifest_section(REGISTER)['sourceid']]} has a bad year/date or format"
222
+ puts "Row #{i}: #{row[get_manifest_section(REGISTER)['sourceid']]} has a bad year/date or format"
223
223
  end
224
224
  end
225
225
  return bad_rows
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: revs-utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.23
4
+ version: 2.1.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Mangiafico
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-13 00:00:00.000000000 Z
11
+ date: 2017-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: countries
@@ -169,7 +169,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
169
169
  version: '0'
170
170
  requirements: []
171
171
  rubyforge_project:
172
- rubygems_version: 2.6.7
172
+ rubygems_version: 2.6.10
173
173
  signing_key:
174
174
  specification_version: 4
175
175
  summary: Shared methods and functions used by revs-indexer, pre-assembly and bulk