revs-utils 1.0.17 → 1.0.18

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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MTM3MDllNTdjMGNiNGI1MTEyNjA5MzRmNTQwZmQ2ZDIzNWY1Njc2ZQ==
4
+ OWU1YmRiOTA5YWE3ODU0NGIyZWVmMWQyZmI4NzI4MDBjOWY3NmNhNQ==
5
5
  data.tar.gz: !binary |-
6
- YjhjMDdlZTJlMzY1ZWY1MWQ1NDcxN2Q2MDg1YTYzNGI0MjJlZDFlMg==
6
+ NWExZjZmYTQyMzIxMGUxMjg3YjI3MjM1NjI5Zjc5YjE3YWFhOTNiNg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- Y2Q4YzUyMjQ3N2IyYTY3NzE5N2Q5MmM4NjkwNjMwMzUyNDAxMDA4MWE1NjNi
10
- YWU0YWNlOGNhYmUwOTBkOWI5MmRiMzQ4ZjQ4NWJkYWU0ZjNmYTFhNzgzMzhj
11
- NTBkMDgwODY4MjI4ZDdjOWVjOGUwZmRmOTEyMDdkYzEyZjk5Zjg=
9
+ ZmQxNmM3YjZhODQzYzJhYTNlN2ZkZmMwNDEyY2YwMmU0ZTVhMDZkYjMzN2Ux
10
+ ZWNlNzQ1YWI4OTBkNjg3OGViMjU3OWIzYWE0NjA0ZjIzZjcyZjFiOWNhYjBi
11
+ MWExZjMwMDFiNDJlODgzMTRkNjQzOTMyZmYzMzhhOTJjNTNkYWE=
12
12
  data.tar.gz: !binary |-
13
- OGU0NGY2OTJkOWQwZjZiM2ZjM2M4NWY1OTcxYzkzM2YzMWY1M2YxYzEwOWMz
14
- ZTA5MWY4NGRiZDJjYzgyYzQzYzQyNWQzYjU0N2IxMTdmNjk2OTY0MmIwMTgz
15
- MTBiZTk3NDM2MGU1YWZmN2JhYjY0YzBlMTVjMWE1N2E3YTU2YWQ=
13
+ MDU3OTY1MTZkMzM3MGJlNmRiODVhODQ5M2VjYTQ5NmU0NWI2YzlmOTJhMTgx
14
+ YTBiMjBiYjhhZTUzMzgxN2JiOTdiMjE2MTNhYWE3MzY2ZDllNzQ2MmQ0MTIz
15
+ MDk3NmIyODgwZmI2MDJjZThjYjNkYzkyMDk3ODVlZTM4NjMxOTI=
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- revs-utils (1.0.15)
4
+ revs-utils (1.0.18)
5
5
  actionpack (~> 3)
6
6
  chronic
7
7
  countries (= 0.9.2)
@@ -1,5 +1,5 @@
1
1
  module Revs
2
2
  module Utils
3
- VERSION = "1.0.17"
3
+ VERSION = "1.0.18"
4
4
  end
5
5
  end
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
@@ -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.17
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-09 00:00:00.000000000 Z
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: