stead 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/README.rdoc +23 -6
  2. data/VERSION +1 -1
  3. data/lib/stead/ead.rb +6 -1
  4. data/lib/stead.rb +4 -1
  5. metadata +3 -11
data/README.rdoc CHANGED
@@ -6,7 +6,7 @@ into a stub EAD XML record.
6
6
  == Story
7
7
 
8
8
  Sometimes donors have spreadsheets which list the contents of their collections.
9
- Rather than retype all of these into Archivists' Toolkit or an XML editor,
9
+ Rather than retype all of these into a tool like Archivists' Toolkit or an XML editor,
10
10
  wouldn't it be nice to automatically generate a stub EAD XML document from the
11
11
  spreadsheet?
12
12
 
@@ -17,15 +17,21 @@ faster and more accurate to do in a spreadsheet than trying to do it elsewhere
17
17
  retyping the whole thing.
18
18
 
19
19
  Once the spreadsheet is ready just save it as a CSV and use the commandline tool
20
- csv2ead to output an EAD XML document. Import into Archivists' Toolkit.
20
+ csv2ead to output an EAD XML document. Enjoy.
21
+
22
+ The EAD XML template is based off of the output generated by Archivists' Toolkit,
23
+ but should work with other systems and XSL stylesheets.
21
24
 
22
25
  == Requirements
23
26
 
24
27
  Ruby
25
28
 
29
+ == Installation
30
+ gem install stead
31
+
26
32
  == Examples that follow the schema
27
33
 
28
- Look in test/contianer_lists/ at the following good examples of the CSV schema:
34
+ Look in test/container_lists/ at the following good examples of the CSV schema:
29
35
  mc00000_container_list.csv
30
36
  mc00000_container_list_no_series.csv
31
37
  The order of the columns does not matter, but the headings must be exactly the
@@ -50,13 +56,19 @@ Please let me know what else you need in such a tool and I'll try to work it in.
50
56
 
51
57
  == Limitations
52
58
 
53
- - Some of this is still be NCSU and Archivists' Toolkit specific.
59
+ - Some of this is still be NCSU and possibly Archivists' Toolkit specific.
54
60
  - This tool has only been used a handful of times so far.
55
61
  - Only works with this specific schema.
56
- - Only known to work with series at the c01 level and files at the c02 level.
57
- Other deeper levels of nesting will not currently work. ()May work with subseries.)
62
+ - Only known to work with series at the c01 level and files at the c02 level. Other deeper levels of nesting will not currently work. (May work with subseries.)
58
63
  - Column values like series must be duplicated for each row.
59
64
 
65
+ == Ruby versions
66
+
67
+ Tested with the following Rubies:
68
+ - 1.8.7-p249
69
+ - 1.8.7-p302
70
+ - 1.9.2-p0
71
+
60
72
  == TODO
61
73
 
62
74
  - More tests (though there are already lots of tests).
@@ -64,11 +76,16 @@ Other deeper levels of nesting will not currently work. ()May work with subserie
64
76
  - Rdoc.
65
77
  - Automate tests of csv2ead tool.
66
78
  - Expand the schema to other parts of the EAD?
79
+ - Create webapp where a user can submit a CSV file and get returned the EAD.
67
80
 
68
81
  == Author
69
82
 
70
83
  Jason Ronallo
71
84
 
85
+ == Thanks
86
+
87
+ Linda Sellars for creating the initial schema.
88
+
72
89
  == Copyright
73
90
 
74
91
  Copyright (c) 2010 North Carolina State University. See LICENSE for details.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.2
1
+ 0.0.3
data/lib/stead/ead.rb CHANGED
@@ -228,7 +228,12 @@ module Stead
228
228
 
229
229
  def csv_to_a
230
230
  a = []
231
- FasterCSV.parse(csv, :headers => :first_row) do |row|
231
+ if CSV.const_defined? :Reader
232
+ csv_class = FasterCSV # old CSV was loaded
233
+ else
234
+ csv_class = CSV # use CSV from 1.9
235
+ end
236
+ csv_class.parse(csv, :headers => :first_row) do |row|
232
237
  a << row.to_hash
233
238
  end
234
239
  if a.first.keys.include?(nil)
data/lib/stead.rb CHANGED
@@ -45,7 +45,10 @@ end
45
45
 
46
46
  require 'rubygems'
47
47
  require 'nokogiri'
48
- require 'fastercsv'
48
+ require 'csv'
49
+ if CSV.const_defined? :Reader
50
+ require 'fastercsv'
51
+ end
49
52
  require 'active_support'
50
53
 
51
54
  require 'pp'
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stead
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
5
4
  prerelease: false
6
5
  segments:
7
6
  - 0
8
7
  - 0
9
- - 2
10
- version: 0.0.2
8
+ - 3
9
+ version: 0.0.3
11
10
  platform: ruby
12
11
  authors:
13
12
  - Jason Ronallo
@@ -15,7 +14,7 @@ autorequire:
15
14
  bindir: bin
16
15
  cert_chain: []
17
16
 
18
- date: 2010-08-08 00:00:00 -04:00
17
+ date: 2010-08-22 00:00:00 -04:00
19
18
  default_executable: csv2ead
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
@@ -26,7 +25,6 @@ dependencies:
26
25
  requirements:
27
26
  - - ">="
28
27
  - !ruby/object:Gem::Version
29
- hash: 5
30
28
  segments:
31
29
  - 1
32
30
  - 4
@@ -42,7 +40,6 @@ dependencies:
42
40
  requirements:
43
41
  - - ">="
44
42
  - !ruby/object:Gem::Version
45
- hash: 3
46
43
  segments:
47
44
  - 1
48
45
  - 5
@@ -58,7 +55,6 @@ dependencies:
58
55
  requirements:
59
56
  - - ">="
60
57
  - !ruby/object:Gem::Version
61
- hash: 9
62
58
  segments:
63
59
  - 2
64
60
  - 3
@@ -74,7 +70,6 @@ dependencies:
74
70
  requirements:
75
71
  - - ">="
76
72
  - !ruby/object:Gem::Version
77
- hash: 83
78
73
  segments:
79
74
  - 1
80
75
  - 16
@@ -90,7 +85,6 @@ dependencies:
90
85
  requirements:
91
86
  - - ">="
92
87
  - !ruby/object:Gem::Version
93
- hash: 3
94
88
  segments:
95
89
  - 0
96
90
  version: "0"
@@ -138,7 +132,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
138
132
  requirements:
139
133
  - - ">="
140
134
  - !ruby/object:Gem::Version
141
- hash: 3
142
135
  segments:
143
136
  - 0
144
137
  version: "0"
@@ -147,7 +140,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
147
140
  requirements:
148
141
  - - ">="
149
142
  - !ruby/object:Gem::Version
150
- hash: 3
151
143
  segments:
152
144
  - 0
153
145
  version: "0"