revs-utils 1.0.17 → 1.0.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/Gemfile.lock +1 -1
- data/lib/revs-utils/version.rb +1 -1
- data/lib/revs-utils.rb +2 -2
- data/spec/revs-utils_spec.rb +5 -1
- data/spec/sample-csv-files/space-sourceid.csv +3 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OWU1YmRiOTA5YWE3ODU0NGIyZWVmMWQyZmI4NzI4MDBjOWY3NmNhNQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NWExZjZmYTQyMzIxMGUxMjg3YjI3MjM1NjI5Zjc5YjE3YWFhOTNiNg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZmQxNmM3YjZhODQzYzJhYTNlN2ZkZmMwNDEyY2YwMmU0ZTVhMDZkYjMzN2Ux
|
10
|
+
ZWNlNzQ1YWI4OTBkNjg3OGViMjU3OWIzYWE0NjA0ZjIzZjcyZjFiOWNhYjBi
|
11
|
+
MWExZjMwMDFiNDJlODgzMTRkNjQzOTMyZmYzMzhhOTJjNTNkYWE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MDU3OTY1MTZkMzM3MGJlNmRiODVhODQ5M2VjYTQ5NmU0NWI2YzlmOTJhMTgx
|
14
|
+
YTBiMjBiYjhhZTUzMzgxN2JiOTdiMjE2MTNhYWE3MzY2ZDllNzQ2MmQ0MTIz
|
15
|
+
MDk3NmIyODgwZmI2MDJjZThjYjNkYzkyMDk3ODVlZTM4NjMxOTI=
|
data/Gemfile.lock
CHANGED
data/lib/revs-utils/version.rb
CHANGED
data/lib/revs-utils.rb
CHANGED
@@ -72,7 +72,7 @@ module Revs
|
|
72
72
|
file.each do |row|
|
73
73
|
#Make sure the sourceid and filename are the same
|
74
74
|
fname = row[get_manifest_section(REGISTER)['filename']].chomp(File.extname(row[get_manifest_section(REGISTER)['filename']]))
|
75
|
-
return false if row[get_manifest_section(REGISTER)['sourceid']] != fname
|
75
|
+
return false if ((row[get_manifest_section(REGISTER)['sourceid']] != fname) || ((/\s/ =~ row[get_manifest_section(REGISTER)['sourceid']].strip) != nil))
|
76
76
|
sources << row[get_manifest_section(REGISTER)['sourceid']]
|
77
77
|
end
|
78
78
|
end
|
@@ -103,7 +103,7 @@ module Revs
|
|
103
103
|
return false if header.downcase !='label' && row[header].blank? #Alternatively consider row[header].class != String or row[header].size <= 0
|
104
104
|
end
|
105
105
|
fname = row[get_manifest_section(REGISTER)['filename']].chomp(File.extname(row[get_manifest_section(REGISTER)['filename']]))
|
106
|
-
return false if row[get_manifest_section(REGISTER)['sourceid']] != fname
|
106
|
+
return false if ((row[get_manifest_section(REGISTER)['sourceid']] != fname) || ((/\s/ =~ row[get_manifest_section(REGISTER)['sourceid']].strip) != nil))
|
107
107
|
sources << row[get_manifest_section(REGISTER)['sourceid']]
|
108
108
|
end
|
109
109
|
return sources.uniq.size == sources.size
|
data/spec/revs-utils_spec.rb
CHANGED
@@ -297,7 +297,11 @@ describe "Revs-Utils" do
|
|
297
297
|
sheets = [Dir.pwd + "/spec/sample-csv-files/malformed-sourceid.csv"]
|
298
298
|
@revs.unique_source_ids(sheets).should == false
|
299
299
|
end
|
300
|
-
|
300
|
+
|
301
|
+
it "should return false when a sourceid has a space in it" do
|
302
|
+
sheets = [Dir.pwd + "/spec/sample-csv-files/space-sourceid.csv"]
|
303
|
+
@revs.unique_source_ids(sheets).should == false
|
304
|
+
end
|
301
305
|
|
302
306
|
|
303
307
|
end
|
@@ -0,0 +1,3 @@
|
|
1
|
+
format,sourceid,collection_name,filename,year,photographer,label,marque,model,model_year,people,location,event,description,inst_notes,prod_notes,has_more_metadata
|
2
|
+
black-and-white negatives,2004-100CRAI-b1_1.0 _0001,Bruce R Craig Photograph Collection,2004-100CRAI-b1_1.0 _0001.tif,,Bruce R Craig,Rutherford Special,Rutherford Special,,,"Rutherford, Slim",,,"full car (rear), #62",,,
|
3
|
+
black-and-white negatives,2004-100CRAI-b1_1.0_0002,Bruce R Craig Photograph Collection,2004-100CRAI-b1_1.0_0002.tif,,Bruce R Craig,City of Roses,City of Roses,,,"Sezekendy, Charley",,,"full car, #2",,,
|
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: 1.0.
|
4
|
+
version: 1.0.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Mangiafico
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: countries
|
@@ -147,6 +147,7 @@ files:
|
|
147
147
|
- spec/sample-csv-files/no-blank-label.csv
|
148
148
|
- spec/sample-csv-files/no-label-column.csv
|
149
149
|
- spec/sample-csv-files/no-sourceid.csv
|
150
|
+
- spec/sample-csv-files/space-sourceid.csv
|
150
151
|
- spec/spec_helper.rb
|
151
152
|
homepage: ''
|
152
153
|
licenses:
|
@@ -186,5 +187,6 @@ test_files:
|
|
186
187
|
- spec/sample-csv-files/no-blank-label.csv
|
187
188
|
- spec/sample-csv-files/no-label-column.csv
|
188
189
|
- spec/sample-csv-files/no-sourceid.csv
|
190
|
+
- spec/sample-csv-files/space-sourceid.csv
|
189
191
|
- spec/spec_helper.rb
|
190
192
|
has_rdoc:
|