revs-utils 2.0.8 → 2.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/Gemfile.lock +2 -2
- 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
|
+
OWFhMTQ0NGIwMjNhNDNhYTUxNjllMWRiZGI3MmJkMDg1NGNlM2U0ZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YTBkM2ZlOWM2YjlkNGNiMzRkNjI5MzEwMjdhNTE1NzJjY2I5YzAzNA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MGQ1Yzk1NWY0YTVmOGIwOTE4Y2UwYjZiN2Y4MWJiMzllYjg4MzMzMzY2Zjkx
|
10
|
+
YmQ0NTZlODQ1ZjU5MGU2OWM5NmYzYjVhZDkwYmIyN2NhYTM4ZmIxOGM4NTYx
|
11
|
+
ZTdhMTUyODdjYjJmM2M3ZWQ4OWVkNjE0MWMzN2YyZWIwZWJkOTM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NTdlZDQ0MGVkZmUwMDVjNjgwNTNlMTQzZDk2MGIwNDZjNjVhZDMxN2IyMmE0
|
14
|
+
MzQ5Mjk3MjI2Y2M2MGJkNjRlMDlmNjA3N2U3NGRjMThhOTM5Y2U2ODE3MzU0
|
15
|
+
MjdiZGE4ZjgzMmZmOWM3NWU3ZDZlNWVhM2NkZTY3NTRlYzMwYzk=
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
revs-utils (2.0.
|
4
|
+
revs-utils (2.0.9)
|
5
5
|
actionpack (~> 4.1.6)
|
6
6
|
chronic
|
7
7
|
countries (= 0.9.2)
|
@@ -44,7 +44,7 @@ GEM
|
|
44
44
|
rake (>= 0.8.7)
|
45
45
|
rest-client
|
46
46
|
mime-types (2.4.3)
|
47
|
-
minitest (5.
|
47
|
+
minitest (5.6.0)
|
48
48
|
netrc (0.10.3)
|
49
49
|
rack (1.5.2)
|
50
50
|
rack-test (0.6.3)
|
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
@@ -303,7 +303,11 @@ describe "Revs-Utils" do
|
|
303
303
|
sheets = [Dir.pwd + "/spec/sample-csv-files/malformed-sourceid.csv"]
|
304
304
|
@revs.unique_source_ids(sheets).should == false
|
305
305
|
end
|
306
|
-
|
306
|
+
|
307
|
+
it "should return false when a sourceid has a space in it" do
|
308
|
+
sheets = [Dir.pwd + "/spec/sample-csv-files/space-sourceid.csv"]
|
309
|
+
@revs.unique_source_ids(sheets).should == false
|
310
|
+
end
|
307
311
|
|
308
312
|
|
309
313
|
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: 2.0.
|
4
|
+
version: 2.0.9
|
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:
|