eadsax 0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.rspec +1 -0
- data/.rvmrc +2 -0
- data/Gemfile +17 -0
- data/Gemfile.lock +34 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +14 -0
- data/Rakefile +50 -0
- data/VERSION +1 -0
- data/bin/eadsax +48 -0
- data/lib/eadsax.rb +75 -0
- data/lib/eadsax/accessrestrict.rb +15 -0
- data/lib/eadsax/accruals.rb +14 -0
- data/lib/eadsax/acqinfo.rb +14 -0
- data/lib/eadsax/address.rb +7 -0
- data/lib/eadsax/altformavail.rb +15 -0
- data/lib/eadsax/appraisal.rb +15 -0
- data/lib/eadsax/archdesc.rb +37 -0
- data/lib/eadsax/arrangement.rb +14 -0
- data/lib/eadsax/bibliography.rb +21 -0
- data/lib/eadsax/bioghist.rb +17 -0
- data/lib/eadsax/blockquote.rb +12 -0
- data/lib/eadsax/change.rb +8 -0
- data/lib/eadsax/chronitem.rb +9 -0
- data/lib/eadsax/chronlist.rb +9 -0
- data/lib/eadsax/components.rb +59 -0
- data/lib/eadsax/container.rb +8 -0
- data/lib/eadsax/controlaccess.rb +25 -0
- data/lib/eadsax/custodhist.rb +16 -0
- data/lib/eadsax/dao.rb +7 -0
- data/lib/eadsax/daodesc.rb +14 -0
- data/lib/eadsax/defitem.rb +8 -0
- data/lib/eadsax/did.rb +23 -0
- data/lib/eadsax/div.rb +15 -0
- data/lib/eadsax/dsc.rb +19 -0
- data/lib/eadsax/ead.rb +9 -0
- data/lib/eadsax/eadheader.rb +10 -0
- data/lib/eadsax/editionstmt.rb +8 -0
- data/lib/eadsax/filedesc.rb +11 -0
- data/lib/eadsax/fileplan.rb +15 -0
- data/lib/eadsax/frontmatter.rb +8 -0
- data/lib/eadsax/index.rb +17 -0
- data/lib/eadsax/indexentry.rb +21 -0
- data/lib/eadsax/list.rb +10 -0
- data/lib/eadsax/listhead.rb +8 -0
- data/lib/eadsax/namegrp.rb +17 -0
- data/lib/eadsax/note.rb +13 -0
- data/lib/eadsax/notestmt.rb +7 -0
- data/lib/eadsax/odd.rb +17 -0
- data/lib/eadsax/originalsloc.rb +15 -0
- data/lib/eadsax/origination.rb +22 -0
- data/lib/eadsax/otherfindaid.rb +21 -0
- data/lib/eadsax/phystech.rb +15 -0
- data/lib/eadsax/prefercite.rb +15 -0
- data/lib/eadsax/processinfo.rb +15 -0
- data/lib/eadsax/profiledesc.rb +9 -0
- data/lib/eadsax/publicationstmt.rb +11 -0
- data/lib/eadsax/relatedmaterial.rb +21 -0
- data/lib/eadsax/revisiondesc.rb +8 -0
- data/lib/eadsax/row.rb +7 -0
- data/lib/eadsax/scopecontent.rb +8 -0
- data/lib/eadsax/separatedmaterial.rb +21 -0
- data/lib/eadsax/seriesstmt.rb +9 -0
- data/lib/eadsax/table.rb +8 -0
- data/lib/eadsax/tbody.rb +7 -0
- data/lib/eadsax/tgroup.rb +9 -0
- data/lib/eadsax/thead.rb +7 -0
- data/lib/eadsax/titlepage.rb +22 -0
- data/lib/eadsax/titleproper.rb +8 -0
- data/lib/eadsax/titlestmt.rb +10 -0
- data/lib/eadsax/userestrict.rb +15 -0
- data/spec/accessrestrict_spec.rb +9 -0
- data/spec/acqinfo_spec.rb +8 -0
- data/spec/archdesc_spec.rb +9 -0
- data/spec/arrangement_spec.rb +11 -0
- data/spec/bioghist_spec.rb +23 -0
- data/spec/chronitem_spec.rb +11 -0
- data/spec/chronlist_spec.rb +11 -0
- data/spec/components_spec.rb +11 -0
- data/spec/controlaccess_spec.rb +11 -0
- data/spec/did_spec.rb +14 -0
- data/spec/dsc_spec.rb +11 -0
- data/spec/ead_spec.rb +9 -0
- data/spec/eadheader_spec.rb +9 -0
- data/spec/eads/example.xml +315 -0
- data/spec/eadsax_spec.rb +8 -0
- data/spec/filedesc_spec.rb +11 -0
- data/spec/prefercite_spec.rb +11 -0
- data/spec/profiledesc_spec.rb +11 -0
- data/spec/publicationstmt_spec.rb +11 -0
- data/spec/scopecontent_spec.rb +13 -0
- data/spec/spec_helper.rb +16 -0
- data/spec/titleproper_spec.rb +11 -0
- data/spec/titlestmt_spec.rb +11 -0
- data/spec/userestrict_spec.rb +11 -0
- data/watchr.rb +34 -0
- metadata +274 -0
@@ -0,0 +1,17 @@
|
|
1
|
+
module Eadsax
|
2
|
+
class Bioghist
|
3
|
+
include SAXMachine
|
4
|
+
element :address, :class => Address
|
5
|
+
element :bioghist, :class => Bioghist
|
6
|
+
element :blockquote, :class => Blockquote
|
7
|
+
element :chronlist, :class => Chronlist
|
8
|
+
element :dao, :class => Dao
|
9
|
+
element :daogrp
|
10
|
+
element :head
|
11
|
+
element :list, :class => List
|
12
|
+
elements :note, :as => :notes
|
13
|
+
elements :p, :as => :ps
|
14
|
+
element :table, :class => Table
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module Eadsax
|
2
|
+
class Blockquote
|
3
|
+
include SAXMachine
|
4
|
+
element :address, :class => Address
|
5
|
+
element :chronlist, :class => Chronlist
|
6
|
+
element :list, :class => List
|
7
|
+
element :note, :class => Note
|
8
|
+
element :p
|
9
|
+
element :table, :class => Table
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
@@ -0,0 +1,59 @@
|
|
1
|
+
module Eadsax
|
2
|
+
module Componentpart
|
3
|
+
def self.included(base_class)
|
4
|
+
base_class.class_eval do
|
5
|
+
element :accessrestrict, :class => Accessrestrict
|
6
|
+
element :accruals, :class => Accruals
|
7
|
+
element :acqinfo, :class => Acqinfo
|
8
|
+
element :altformavail, :class => Altformavail
|
9
|
+
element :appraisal, :class => Appraisal
|
10
|
+
element :arrangement, :class => Arrangement
|
11
|
+
element :bibliography, :class => Bibliography
|
12
|
+
element :bioghist, :class => Bioghist
|
13
|
+
element :controlaccess, :class => Controlaccess
|
14
|
+
element :custodhist, :class => Custodhist
|
15
|
+
element :dao, :class => Dao
|
16
|
+
element :did, :class => Did
|
17
|
+
element :dsc, :class => Dsc
|
18
|
+
element :fileplan, :class => Fileplan
|
19
|
+
element :head
|
20
|
+
element :index, :class => Index
|
21
|
+
elements :note, :as => :notes, :class => Note
|
22
|
+
element :odd, :class => Odd
|
23
|
+
element :originalsloc, :class => Originalsloc
|
24
|
+
element :otherfindaid, :class => Otherfindaid
|
25
|
+
element :phystech, :class => Phystech
|
26
|
+
element :prefercite, :class => Prefercite
|
27
|
+
element :processinfo, :class => Processinfo
|
28
|
+
element :relatedmaterial, :class => Relatedmaterial
|
29
|
+
element :scopecontent, :class => Scopecontent
|
30
|
+
element :separatedmaterial, :class => Separatedmaterial
|
31
|
+
element :thead, :class => Thead
|
32
|
+
element :userestrict, :class => Userestrict
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
# define component part classes dynamically to dry them up
|
39
|
+
(1..12).to_a.reverse.each do |number|
|
40
|
+
cls = Class.new do
|
41
|
+
include SAXMachine
|
42
|
+
include Eadsax::Componentpart
|
43
|
+
part = "c%02d" % number.to_s
|
44
|
+
part_sym = part.to_sym
|
45
|
+
part_sym_plural = (part + 's').to_sym
|
46
|
+
|
47
|
+
next_part = ("c%02d" % (number + 1).to_s)
|
48
|
+
next_part_sym = next_part.to_sym
|
49
|
+
next_part_sym_plural = (next_part + 's').to_sym
|
50
|
+
|
51
|
+
element part_sym, :as => :level, :value => :level
|
52
|
+
element part_sym, :as => :identifier, :value => :id
|
53
|
+
if (number + 1 < 12)
|
54
|
+
elements next_part_sym, :as => next_part_sym_plural, :class => Eadsax.const_get(('C%02d' % (number + 1).to_s))
|
55
|
+
end
|
56
|
+
end
|
57
|
+
Eadsax.const_set 'C%02d' % number.to_s, cls
|
58
|
+
end
|
59
|
+
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Eadsax
|
2
|
+
class Controlaccess
|
3
|
+
include SAXMachine
|
4
|
+
element :address, :class => Address
|
5
|
+
element :blockquote, :class => Blockquote
|
6
|
+
element :chronlist, :class => Chronlist
|
7
|
+
element :controlaccess, :class => Controlaccess
|
8
|
+
elements :corpname, :as => :corpnames
|
9
|
+
elements :famname, :as => :famnames
|
10
|
+
element :function
|
11
|
+
elements :genreform, :as => :genreforms
|
12
|
+
elements :geogname, :as => :geognames
|
13
|
+
element :head
|
14
|
+
elements :list, :as => :lists, :class => List
|
15
|
+
elements :name, :as => :names
|
16
|
+
elements :note, :as => :notes, :class => Note
|
17
|
+
elements :occupation, :as => :occupations
|
18
|
+
elements :p, :as => :ps
|
19
|
+
elements :persname, :as => :persnames
|
20
|
+
elements :subject, :as => :subjects
|
21
|
+
element :table, :class => Table
|
22
|
+
element :title
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Eadsax
|
2
|
+
class Custodhist
|
3
|
+
include SAXMachine
|
4
|
+
element :acqinfo, :class => Acqinfo
|
5
|
+
element :address, :class => Address
|
6
|
+
element :blockquote, :class => Blockquote
|
7
|
+
element :chronlist, :class => Chronlist
|
8
|
+
element :custodhist, :class => Custodhist
|
9
|
+
element :head
|
10
|
+
elements :list, :as => :lists, :class => List
|
11
|
+
elements :note, :as => :notes, :class => Note
|
12
|
+
elements :p, :as => :ps
|
13
|
+
element :table, :class => Table
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
data/lib/eadsax/dao.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
module Eadsax
|
2
|
+
class Daodesc
|
3
|
+
include SAXMachine
|
4
|
+
element :address, :class => Address
|
5
|
+
element :blockquote, :class => Blockquote
|
6
|
+
element :chronlist, :class => Chronlist
|
7
|
+
element :head
|
8
|
+
element :list, :class => List
|
9
|
+
elements :note, :as => :notes, :class => Note
|
10
|
+
elements :p, :as => :ps
|
11
|
+
element :table, :class => Table
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
data/lib/eadsax/did.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
module Eadsax
|
2
|
+
class Did
|
3
|
+
include SAXMachine
|
4
|
+
elements :abstract, :as => :abstracts
|
5
|
+
elements :container, :as => :containers#, :class => Container
|
6
|
+
elements :container, :value => :type, :as => :container_types#, :class => Container
|
7
|
+
element :dao, :class => Dao
|
8
|
+
element :daogrp
|
9
|
+
element :head
|
10
|
+
element :langmaterial
|
11
|
+
element :materialspec
|
12
|
+
element :note, :class => Note
|
13
|
+
element :origination, :class => Origination
|
14
|
+
element :physdesc
|
15
|
+
element :physloc
|
16
|
+
element :repository
|
17
|
+
element :unitdate
|
18
|
+
element :unitid
|
19
|
+
element :unittitle
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
data/lib/eadsax/div.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
module Eadsax
|
2
|
+
class Div
|
3
|
+
include SAXMachine
|
4
|
+
element :address, :class => Address
|
5
|
+
element :blockquote, :class => Blockquote
|
6
|
+
element :chronlist, :class => Chronlist
|
7
|
+
element :div, :class => Div
|
8
|
+
element :head
|
9
|
+
element :list, :class => List
|
10
|
+
element :note, :class => Note
|
11
|
+
element :p
|
12
|
+
element :table, :class => Table
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
data/lib/eadsax/dsc.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
module Eadsax
|
2
|
+
class Dsc
|
3
|
+
include SAXMachine
|
4
|
+
elements :c01, :as => :c01s, :class => C01
|
5
|
+
|
6
|
+
element :address, :class => Address
|
7
|
+
element :blockquote, :class => Blockquote
|
8
|
+
element :c
|
9
|
+
element :chronlist, :class => Chronlist
|
10
|
+
element :dsc, :class => Dsc
|
11
|
+
element :head
|
12
|
+
elements :list, :class => List
|
13
|
+
elements :note, :as => :notes, :class => Note
|
14
|
+
elements :p, :as => :ps
|
15
|
+
element :table, :class => Table
|
16
|
+
element :thead, :class => Thead
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
data/lib/eadsax/ead.rb
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
module Eadsax
|
2
|
+
class Filedesc
|
3
|
+
include SAXMachine
|
4
|
+
element :editionstmt, :class => Editionstmt
|
5
|
+
element :notestmt, :class => Notestmt
|
6
|
+
element :publicationstmt, :class => Publicationstmt
|
7
|
+
element :seriesstmt, :class => Seriesstmt
|
8
|
+
element :titlestmt, :class => Titlestmt
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Eadsax
|
2
|
+
class Fileplan
|
3
|
+
include SAXMachine
|
4
|
+
element :address, :class => Address
|
5
|
+
element :blockquote, :class => Blockquote
|
6
|
+
element :chronlist, :class => Chronlist
|
7
|
+
element :fileplan, :class => Fileplan
|
8
|
+
element :head
|
9
|
+
element :list, :class => List
|
10
|
+
element :note, :class => Note
|
11
|
+
element :p
|
12
|
+
element :table, :class => Table
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
data/lib/eadsax/index.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
module Eadsax
|
2
|
+
class Index
|
3
|
+
include SAXMachine
|
4
|
+
element :address, :class => Address
|
5
|
+
element :blockquote, :class => Blockquote
|
6
|
+
element :chronlist, :class => Chronlist
|
7
|
+
element :head
|
8
|
+
element :index, :class => Index
|
9
|
+
element :indexentry, :class => Indexentry
|
10
|
+
element :list, :class => List
|
11
|
+
element :listhead, :class => Listhead
|
12
|
+
element :note, :class => Note
|
13
|
+
element :p
|
14
|
+
element :table, :class => Table
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Eadsax
|
2
|
+
class Indexentry
|
3
|
+
include SAXMachine
|
4
|
+
element :corpname
|
5
|
+
element :famname
|
6
|
+
element :function
|
7
|
+
element :genreform
|
8
|
+
element :geogname
|
9
|
+
element :indexentry
|
10
|
+
element :name
|
11
|
+
element :namegrp, :class => Namegrp
|
12
|
+
element :occupation
|
13
|
+
element :persname
|
14
|
+
element :ptr
|
15
|
+
element :ptrgrp
|
16
|
+
element :ref
|
17
|
+
element :subject
|
18
|
+
element :title
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
data/lib/eadsax/list.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
module Eadsax
|
2
|
+
class Namegrp
|
3
|
+
include SAXMachine
|
4
|
+
element :corpname
|
5
|
+
element :famname
|
6
|
+
element :function
|
7
|
+
element :genreform
|
8
|
+
element :geogname
|
9
|
+
element :name
|
10
|
+
element :note, :class => Note
|
11
|
+
element :occupation
|
12
|
+
element :persname
|
13
|
+
element :subject
|
14
|
+
element :title
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
data/lib/eadsax/note.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
module Eadsax
|
2
|
+
class Note
|
3
|
+
include SAXMachine
|
4
|
+
element :address, :class => Address
|
5
|
+
element :blockquote, :class => Blockquote
|
6
|
+
element :chronlist, :class => Chronlist
|
7
|
+
element :list, :class => List
|
8
|
+
element :note, :class => Note
|
9
|
+
element :p
|
10
|
+
element :table, :class => Table
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|