stead 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/stead/ead.rb +3 -3
- data/stead.gemspec +5 -2
- data/test/container_lists/snyderman3.csv +3 -0
- data/test/test_duplicate_series_title.rb +30 -0
- data/test/test_ead_series.rb +2 -2
- metadata +7 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.10
|
data/lib/stead/ead.rb
CHANGED
@@ -169,9 +169,9 @@ module Stead
|
|
169
169
|
end
|
170
170
|
|
171
171
|
def find_current_series(cp)
|
172
|
-
|
173
|
-
@ead.xpath("//xmlns:c01/xmlns:did/xmlns:
|
174
|
-
return node.parent.parent if node.content ==
|
172
|
+
series_number = cp['series number']
|
173
|
+
@ead.xpath("//xmlns:c01/xmlns:did/xmlns:unitid").each do |node|
|
174
|
+
return node.parent.parent if node.content == series_number
|
175
175
|
end
|
176
176
|
end
|
177
177
|
|
data/stead.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{stead}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.10"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Jason Ronallo"]
|
12
|
-
s.date = %q{2011-08-
|
12
|
+
s.date = %q{2011-08-15}
|
13
13
|
s.default_executable = %q{csv2ead}
|
14
14
|
s.description = %q{Converts CSV files of a specific schema into EAD XML.}
|
15
15
|
s.email = %q{jronallo@gmail.com}
|
@@ -43,8 +43,10 @@ Gem::Specification.new do |s|
|
|
43
43
|
"test/container_lists/mc00000_container_list_bad_container_type.csv",
|
44
44
|
"test/container_lists/mc00000_container_list_no_series.csv",
|
45
45
|
"test/container_lists/mc00084_container_list_empty_header.csv",
|
46
|
+
"test/container_lists/snyderman3.csv",
|
46
47
|
"test/container_lists/wheless.csv",
|
47
48
|
"test/helper.rb",
|
49
|
+
"test/test_duplicate_series_title.rb",
|
48
50
|
"test/test_ead_bad_container_type.rb",
|
49
51
|
"test/test_ead_no_series.rb",
|
50
52
|
"test/test_ead_series.rb",
|
@@ -59,6 +61,7 @@ Gem::Specification.new do |s|
|
|
59
61
|
s.test_files = [
|
60
62
|
"examples/ncsu.rb",
|
61
63
|
"test/helper.rb",
|
64
|
+
"test/test_duplicate_series_title.rb",
|
62
65
|
"test/test_ead_bad_container_type.rb",
|
63
66
|
"test/test_ead_no_series.rb",
|
64
67
|
"test/test_ead_series.rb",
|
@@ -0,0 +1,3 @@
|
|
1
|
+
"series number","series title","file title","instance type","container 1 type","container 1 number"
|
2
|
+
87,"Outside","AAHC (Association of Academic Health Centers)","Mixed materials","Box",157
|
3
|
+
100,"Outside","AAMC - Advisory Panel, Strategic Positioning for Health Care Reform","Mixed materials","Box",181
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
class TestDuplicateSeriesTitle < Test::Unit::TestCase
|
4
|
+
|
5
|
+
def setup
|
6
|
+
@xsd = Nokogiri::XML::Schema(File.read(Stead.ead_schema))
|
7
|
+
|
8
|
+
#@example = Nokogiri::XML(File.read(File.join(File.dirname(__FILE__),
|
9
|
+
# 'container_lists', 'snyderman2.xml' )))
|
10
|
+
@ead_generator = Stead::EadGenerator.from_csv(File.read(File.join(File.dirname(__FILE__),
|
11
|
+
'container_lists', 'snyderman3.csv' )))
|
12
|
+
@generated_ead = @ead_generator.to_ead
|
13
|
+
end
|
14
|
+
|
15
|
+
def test_c01_counts
|
16
|
+
assert_equal 2, @generated_ead.xpath('//xmlns:c01').length
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_c02_counts
|
20
|
+
assert_equal 2, @generated_ead.xpath('//xmlns:c02').length
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_each_c01_has_one_c02
|
24
|
+
@generated_ead.xpath('//xmlns:c01').each do |c01|
|
25
|
+
assert_equal 1, c01.xpath('xmlns:c02').length
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
|
30
|
+
end
|
data/test/test_ead_series.rb
CHANGED
@@ -5,13 +5,13 @@ class TestSteadEadSeries < Test::Unit::TestCase
|
|
5
5
|
|
6
6
|
def setup
|
7
7
|
@xsd = Nokogiri::XML::Schema(File.read(Stead.ead_schema))
|
8
|
-
|
8
|
+
|
9
9
|
@example = Nokogiri::XML(File.read(File.join(File.dirname(__FILE__),
|
10
10
|
'container_lists', 'mc00000-ead-series.xml' )))
|
11
11
|
@ead_generator = Stead::EadGenerator.from_csv(File.read(File.join(File.dirname(__FILE__),
|
12
12
|
'container_lists', 'mc00000_container_list.csv' )))
|
13
13
|
@generated_ead = @ead_generator.to_ead
|
14
|
-
|
14
|
+
|
15
15
|
@did_xpath = '//xmlns:c02/xmlns:did'
|
16
16
|
end
|
17
17
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stead
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 11
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 10
|
10
|
+
version: 0.0.10
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jason Ronallo
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-08-
|
18
|
+
date: 2011-08-15 00:00:00 -04:00
|
19
19
|
default_executable: csv2ead
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -182,8 +182,10 @@ files:
|
|
182
182
|
- test/container_lists/mc00000_container_list_bad_container_type.csv
|
183
183
|
- test/container_lists/mc00000_container_list_no_series.csv
|
184
184
|
- test/container_lists/mc00084_container_list_empty_header.csv
|
185
|
+
- test/container_lists/snyderman3.csv
|
185
186
|
- test/container_lists/wheless.csv
|
186
187
|
- test/helper.rb
|
188
|
+
- test/test_duplicate_series_title.rb
|
187
189
|
- test/test_ead_bad_container_type.rb
|
188
190
|
- test/test_ead_no_series.rb
|
189
191
|
- test/test_ead_series.rb
|
@@ -227,6 +229,7 @@ summary: Spreadsheets To Encoded Archival Description
|
|
227
229
|
test_files:
|
228
230
|
- examples/ncsu.rb
|
229
231
|
- test/helper.rb
|
232
|
+
- test/test_duplicate_series_title.rb
|
230
233
|
- test/test_ead_bad_container_type.rb
|
231
234
|
- test/test_ead_no_series.rb
|
232
235
|
- test/test_ead_series.rb
|