stead 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -14,6 +14,7 @@ begin
14
14
  gem.add_dependency "fastercsv", ">= 1.5.0"
15
15
  gem.add_dependency "trollop", ">= 1.16.2"
16
16
  gem.add_development_dependency "shoulda", ">= 0"
17
+ gem.add_development_dependency 'equivalent-xml'
17
18
  gem.files = FileList["[A-Z]*", "{bin,examples,lib}/**/*"]
18
19
  # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
19
20
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.7
1
+ 0.0.8
data/lib/stead/ead.rb CHANGED
@@ -176,7 +176,11 @@ module Stead
176
176
  if !container_type.nil? and !container_number.nil? and !container_type.empty? and !container_number.empty?
177
177
  container_type.strip!
178
178
  unless valid_container_type?(container_type)
179
- raise Stead::InvalidContainerType, %Q{"#{container_type}"}
179
+ if !valid_container_type?(container_type.downcase)
180
+ raise Stead::InvalidContainerType, %Q{"#{container_type}"}
181
+ else
182
+ container_type = container_type.downcase
183
+ end
180
184
  end
181
185
  container = node('container')
182
186
  container['type'] = container_type
@@ -191,7 +195,6 @@ module Stead
191
195
  ['geogname', 'corpname', 'famname', 'name', 'persname', 'subject'].each do |controlaccess_type|
192
196
  if cp[controlaccess_type]
193
197
  controlaccess = component_part.xpath('controlaccess').first
194
- # debugger
195
198
  if !controlaccess
196
199
  controlaccess = node('controlaccess')
197
200
  end
@@ -17,7 +17,7 @@ class TestSteadErrors < Test::Unit::TestCase
17
17
  begin
18
18
  @ead_generator.to_ead
19
19
  rescue Stead::InvalidContainerType => error
20
- assert_equal '"Box"', error.message
20
+ assert_equal '"Boxer"', error.message
21
21
  end
22
22
  end
23
23
 
@@ -11,8 +11,13 @@ class TestWheless < Test::Unit::TestCase
11
11
 
12
12
  def test_lack_of_empty_c01_at_end
13
13
  last_c01 = @generated_ead.xpath('//xmlns:c01').last
14
- assert !EquivalentXml.equivalent?("<c01 level=\"file\">\n <did/>\n</c01>",
14
+ assert !EquivalentXml.equivalent?("<c01 level=\"file\">\n <did/>\n</c01>",
15
15
  last_c01.to_xml, opts = { :element_order => false, :normalize_whitespace => true })
16
16
  end
17
+
18
+ def test_capitalized_container_type_is_converted
19
+ last_c02 = @generated_ead.xpath('//xmlns:c02').last
20
+ assert 'box', last_c02.xpath('xmlns:did/xmlns:container').first.attribute('type')
21
+ end
17
22
 
18
23
  end
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: 17
4
+ hash: 15
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 7
10
- version: 0.0.7
9
+ - 8
10
+ version: 0.0.8
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-02-25 00:00:00 -05:00
18
+ date: 2011-02-26 00:00:00 -05:00
19
19
  default_executable: csv2ead
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -80,6 +80,20 @@ dependencies:
80
80
  version: "0"
81
81
  type: :development
82
82
  version_requirements: *id004
83
+ - !ruby/object:Gem::Dependency
84
+ name: equivalent-xml
85
+ prerelease: false
86
+ requirement: &id005 !ruby/object:Gem::Requirement
87
+ none: false
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ hash: 3
92
+ segments:
93
+ - 0
94
+ version: "0"
95
+ type: :development
96
+ version_requirements: *id005
83
97
  description: Converts CSV files of a specific schema into EAD XML.
84
98
  email: jronallo@gmail.com
85
99
  executables:
@@ -103,12 +117,12 @@ files:
103
117
  - lib/stead/templates/ead.xml
104
118
  - lib/stead/templates/ead.xsd
105
119
  - lib/stead/templates/ncsu_ead.xml
106
- - test/test_ead_no_series.rb
107
- - test/test_empty_note.rb
108
120
  - test/test_ead_bad_container_type.rb
109
- - test/test_ead_series.rb
110
121
  - test/helper.rb
111
122
  - test/test_stead.rb
123
+ - test/test_wheless.rb
124
+ - test/test_ead_no_series.rb
125
+ - test/test_ead_series.rb
112
126
  has_rdoc: true
113
127
  homepage: http://github.com/jronallo/stead
114
128
  licenses: []
@@ -144,10 +158,10 @@ signing_key:
144
158
  specification_version: 3
145
159
  summary: Spreadsheets To Encoded Archival Description
146
160
  test_files:
147
- - test/test_ead_no_series.rb
148
- - test/test_empty_note.rb
149
161
  - test/test_ead_bad_container_type.rb
150
- - test/test_ead_series.rb
151
162
  - test/helper.rb
152
163
  - test/test_stead.rb
164
+ - test/test_wheless.rb
165
+ - test/test_ead_no_series.rb
166
+ - test/test_ead_series.rb
153
167
  - examples/ncsu.rb