loc_mods 0.2.4 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -0
- data/.rubocop_todo.yml +87 -0
- data/lib/loc_mods/abstract.rb +9 -9
- data/lib/loc_mods/access_condition.rb +11 -11
- data/lib/loc_mods/alternative_name.rb +10 -10
- data/lib/loc_mods/area.rb +3 -3
- data/lib/loc_mods/cartographic_extension.rb +4 -4
- data/lib/loc_mods/cartographics.rb +8 -8
- data/lib/loc_mods/city_section.rb +3 -3
- data/lib/loc_mods/classification.rb +10 -8
- data/lib/loc_mods/cli.rb +2 -3
- data/lib/loc_mods/collection.rb +3 -3
- data/lib/loc_mods/copy_information.rb +5 -5
- data/lib/loc_mods/date.rb +8 -8
- data/lib/loc_mods/date_other.rb +4 -4
- data/lib/loc_mods/detail.rb +7 -7
- data/lib/loc_mods/edition.rb +4 -4
- data/lib/loc_mods/enumeration_and_chronology.rb +4 -4
- data/lib/loc_mods/extent.rb +4 -4
- data/lib/loc_mods/extent_definition.rb +7 -7
- data/lib/loc_mods/form.rb +5 -5
- data/lib/loc_mods/genre.rb +8 -8
- data/lib/loc_mods/geographic_code.rb +6 -6
- data/lib/loc_mods/hierarchical_geographic.rb +6 -6
- data/lib/loc_mods/hierarchical_part.rb +8 -8
- data/lib/loc_mods/holding_simple.rb +2 -2
- data/lib/loc_mods/identifier.rb +8 -8
- data/lib/loc_mods/item_identifier.rb +4 -4
- data/lib/loc_mods/language.rb +9 -9
- data/lib/loc_mods/language_term.rb +7 -7
- data/lib/loc_mods/location.rb +8 -8
- data/lib/loc_mods/name.rb +19 -19
- data/lib/loc_mods/name_part.rb +4 -4
- data/lib/loc_mods/non_sort.rb +4 -4
- data/lib/loc_mods/note.rb +7 -7
- data/lib/loc_mods/occupation.rb +6 -6
- data/lib/loc_mods/origin_info.rb +11 -11
- data/lib/loc_mods/part.rb +10 -10
- data/lib/loc_mods/physical_description.rb +11 -11
- data/lib/loc_mods/physical_description_note.rb +7 -7
- data/lib/loc_mods/physical_location.rb +5 -5
- data/lib/loc_mods/place.rb +3 -3
- data/lib/loc_mods/place_term.rb +7 -7
- data/lib/loc_mods/publisher.rb +6 -6
- data/lib/loc_mods/record.rb +5 -5
- data/lib/loc_mods/record_content_source.rb +4 -4
- data/lib/loc_mods/record_identifier.rb +4 -4
- data/lib/loc_mods/record_info.rb +9 -9
- data/lib/loc_mods/record_info_note.rb +8 -8
- data/lib/loc_mods/region.rb +3 -3
- data/lib/loc_mods/related_item.rb +10 -10
- data/lib/loc_mods/role.rb +2 -2
- data/lib/loc_mods/role_term.rb +4 -4
- data/lib/loc_mods/script_term.rb +4 -4
- data/lib/loc_mods/string_plus_language.rb +6 -6
- data/lib/loc_mods/string_plus_language_plus_authority.rb +6 -6
- data/lib/loc_mods/string_plus_language_plus_supplied.rb +4 -4
- data/lib/loc_mods/subject.rb +16 -16
- data/lib/loc_mods/subject_name.rb +14 -14
- data/lib/loc_mods/subject_title_info.rb +16 -16
- data/lib/loc_mods/table_of_contents.rb +9 -9
- data/lib/loc_mods/target_audience.rb +7 -5
- data/lib/loc_mods/temporal.rb +5 -5
- data/lib/loc_mods/text.rb +5 -5
- data/lib/loc_mods/title_info.rb +22 -22
- data/lib/loc_mods/type_of_resource.rb +8 -8
- data/lib/loc_mods/url.rb +8 -8
- data/lib/loc_mods/version.rb +1 -1
- data/lib/loc_mods.rb +7 -6
- metadata +8 -9
- data/lib/loc_mods/base_mapper.rb +0 -26
- data/lib/loc_mods/comparable_mapper.rb +0 -501
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require "lutaml/model"
|
4
4
|
|
5
5
|
require_relative "abstract"
|
6
6
|
require_relative "access_condition"
|
@@ -23,14 +23,14 @@ require_relative "title_info"
|
|
23
23
|
require_relative "type_of_resource"
|
24
24
|
|
25
25
|
module LocMods
|
26
|
-
class RelatedItem <
|
27
|
-
attribute :type,
|
28
|
-
attribute :other_type,
|
29
|
-
attribute :other_type_auth,
|
30
|
-
attribute :other_type_auth_uri,
|
31
|
-
attribute :other_type_uri,
|
32
|
-
attribute :display_label,
|
33
|
-
attribute :id,
|
26
|
+
class RelatedItem < Lutaml::Model::Serializable
|
27
|
+
attribute :type, :string
|
28
|
+
attribute :other_type, :string
|
29
|
+
attribute :other_type_auth, :string
|
30
|
+
attribute :other_type_auth_uri, :string
|
31
|
+
attribute :other_type_uri, :string
|
32
|
+
attribute :display_label, :string
|
33
|
+
attribute :id, :string
|
34
34
|
attribute :abstract, Abstract, collection: true
|
35
35
|
attribute :access_condition, AccessCondition, collection: true
|
36
36
|
attribute :classification, Classification, collection: true
|
@@ -51,7 +51,7 @@ module LocMods
|
|
51
51
|
attribute :target_audience, TargetAudience, collection: true
|
52
52
|
attribute :title_info, TitleInfo, collection: true
|
53
53
|
attribute :type_of_resource, TypeOfResource, collection: true
|
54
|
-
attribute :href,
|
54
|
+
attribute :href, :string
|
55
55
|
|
56
56
|
xml do
|
57
57
|
root "relatedItem"
|
data/lib/loc_mods/role.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require "lutaml/model"
|
4
4
|
|
5
5
|
require_relative "role_term"
|
6
6
|
|
7
7
|
module LocMods
|
8
|
-
class Role <
|
8
|
+
class Role < Lutaml::Model::Serializable
|
9
9
|
attribute :role_term, RoleTerm, collection: true
|
10
10
|
|
11
11
|
xml do
|
data/lib/loc_mods/role_term.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require "lutaml/model"
|
4
4
|
|
5
5
|
module LocMods
|
6
|
-
class RoleTerm <
|
7
|
-
attribute :content,
|
8
|
-
attribute :type,
|
6
|
+
class RoleTerm < Lutaml::Model::Serializable
|
7
|
+
attribute :content, :string
|
8
|
+
attribute :type, :string
|
9
9
|
|
10
10
|
xml do
|
11
11
|
root "roleTerm"
|
data/lib/loc_mods/script_term.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require "lutaml/model"
|
4
4
|
|
5
5
|
module LocMods
|
6
|
-
class ScriptTerm <
|
7
|
-
attribute :content,
|
8
|
-
attribute :type,
|
6
|
+
class ScriptTerm < Lutaml::Model::Serializable
|
7
|
+
attribute :content, :string
|
8
|
+
attribute :type, :string
|
9
9
|
|
10
10
|
xml do
|
11
11
|
root "scriptTerm"
|
@@ -1,13 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require "lutaml/model"
|
4
4
|
|
5
5
|
module LocMods
|
6
|
-
class StringPlusLanguage <
|
7
|
-
attribute :content,
|
8
|
-
attribute :lang,
|
9
|
-
attribute :script,
|
10
|
-
attribute :transliteration,
|
6
|
+
class StringPlusLanguage < Lutaml::Model::Serializable
|
7
|
+
attribute :content, :string
|
8
|
+
attribute :lang, :string
|
9
|
+
attribute :script, :string
|
10
|
+
attribute :transliteration, :string
|
11
11
|
|
12
12
|
xml do
|
13
13
|
root "nonSort"
|
@@ -1,12 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require "lutaml/model"
|
4
4
|
|
5
5
|
module LocMods
|
6
|
-
class StringPlusLanguagePlusAuthority <
|
7
|
-
attribute :content,
|
8
|
-
attribute :authority,
|
9
|
-
attribute :authority_uri,
|
10
|
-
attribute :value_uri,
|
6
|
+
class StringPlusLanguagePlusAuthority < Lutaml::Model::Serializable
|
7
|
+
attribute :content, :string
|
8
|
+
attribute :authority, :string
|
9
|
+
attribute :authority_uri, :string
|
10
|
+
attribute :value_uri, :string
|
11
11
|
end
|
12
12
|
end
|
@@ -1,10 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require "lutaml/model"
|
4
4
|
|
5
5
|
module LocMods
|
6
|
-
class StringPlusLanguagePlusSupplied <
|
7
|
-
attribute :content,
|
8
|
-
attribute :supplied,
|
6
|
+
class StringPlusLanguagePlusSupplied < Lutaml::Model::Serializable
|
7
|
+
attribute :content, :string
|
8
|
+
attribute :supplied, :string
|
9
9
|
end
|
10
10
|
end
|
data/lib/loc_mods/subject.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require "lutaml/model"
|
4
4
|
|
5
5
|
require_relative "cartographics"
|
6
6
|
require_relative "genre"
|
@@ -12,19 +12,19 @@ require_relative "temporal"
|
|
12
12
|
require_relative "occupation"
|
13
13
|
|
14
14
|
module LocMods
|
15
|
-
class Subject <
|
16
|
-
attribute :id,
|
17
|
-
attribute :authority,
|
18
|
-
attribute :authority_uri,
|
19
|
-
attribute :value_uri,
|
20
|
-
attribute :lang,
|
21
|
-
attribute :script,
|
22
|
-
attribute :transliteration,
|
23
|
-
attribute :display_label,
|
24
|
-
attribute :alt_rep_group,
|
25
|
-
attribute :usage,
|
26
|
-
attribute :topic,
|
27
|
-
attribute :geographic,
|
15
|
+
class Subject < Lutaml::Model::Serializable
|
16
|
+
attribute :id, :string
|
17
|
+
attribute :authority, :string
|
18
|
+
attribute :authority_uri, :string
|
19
|
+
attribute :value_uri, :string
|
20
|
+
attribute :lang, :string
|
21
|
+
attribute :script, :string
|
22
|
+
attribute :transliteration, :string
|
23
|
+
attribute :display_label, :string
|
24
|
+
attribute :alt_rep_group, :string
|
25
|
+
attribute :usage, :string
|
26
|
+
attribute :topic, :string, collection: true
|
27
|
+
attribute :geographic, :string, collection: true
|
28
28
|
attribute :temporal, Temporal, collection: true
|
29
29
|
attribute :title_info, SubjectTitleInfo, collection: true
|
30
30
|
attribute :name, SubjectName, collection: true
|
@@ -33,10 +33,10 @@ module LocMods
|
|
33
33
|
attribute :cartographics, Cartographics, collection: true
|
34
34
|
attribute :occupation, Occupation, collection: true
|
35
35
|
attribute :genre, Genre, collection: true
|
36
|
-
attribute :href,
|
36
|
+
attribute :href, :string
|
37
37
|
|
38
38
|
xml do
|
39
|
-
root "subject"
|
39
|
+
root "subject", ordered: true
|
40
40
|
namespace "http://www.loc.gov/mods/v3", nil
|
41
41
|
|
42
42
|
map_attribute "href", to: :href,
|
@@ -1,27 +1,27 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require "lutaml/model"
|
4
4
|
|
5
5
|
require_relative "identifier"
|
6
6
|
require_relative "name_part"
|
7
7
|
require_relative "role"
|
8
8
|
|
9
9
|
module LocMods
|
10
|
-
class SubjectName <
|
11
|
-
attribute :type,
|
12
|
-
attribute :id,
|
13
|
-
attribute :authority,
|
14
|
-
attribute :authority_uri,
|
15
|
-
attribute :value_uri,
|
16
|
-
attribute :lang,
|
17
|
-
attribute :script,
|
18
|
-
attribute :transliteration,
|
19
|
-
attribute :display_label,
|
10
|
+
class SubjectName < Lutaml::Model::Serializable
|
11
|
+
attribute :type, :string
|
12
|
+
attribute :id, :string
|
13
|
+
attribute :authority, :string
|
14
|
+
attribute :authority_uri, :string
|
15
|
+
attribute :value_uri, :string
|
16
|
+
attribute :lang, :string
|
17
|
+
attribute :script, :string
|
18
|
+
attribute :transliteration, :string
|
19
|
+
attribute :display_label, :string
|
20
20
|
attribute :name_part, NamePart, collection: true
|
21
|
-
attribute :display_form,
|
22
|
-
attribute :affiliation,
|
21
|
+
attribute :display_form, :string, collection: true
|
22
|
+
attribute :affiliation, :string, collection: true
|
23
23
|
attribute :role, Role, collection: true
|
24
|
-
attribute :description,
|
24
|
+
attribute :description, :string, collection: true
|
25
25
|
attribute :name_identifier, Identifier, collection: true
|
26
26
|
|
27
27
|
xml do
|
@@ -1,23 +1,23 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require "lutaml/model"
|
4
4
|
|
5
5
|
module LocMods
|
6
|
-
class SubjectTitleInfo <
|
7
|
-
attribute :id,
|
8
|
-
attribute :authority,
|
9
|
-
attribute :authority_uri,
|
10
|
-
attribute :value_uri,
|
11
|
-
attribute :lang,
|
12
|
-
attribute :script,
|
13
|
-
attribute :transliteration,
|
14
|
-
attribute :display_label,
|
15
|
-
attribute :type,
|
16
|
-
attribute :title,
|
17
|
-
attribute :sub_title,
|
18
|
-
attribute :part_number,
|
19
|
-
attribute :part_name,
|
20
|
-
attribute :non_sort,
|
6
|
+
class SubjectTitleInfo < Lutaml::Model::Serializable
|
7
|
+
attribute :id, :string
|
8
|
+
attribute :authority, :string
|
9
|
+
attribute :authority_uri, :string
|
10
|
+
attribute :value_uri, :string
|
11
|
+
attribute :lang, :string
|
12
|
+
attribute :script, :string
|
13
|
+
attribute :transliteration, :string
|
14
|
+
attribute :display_label, :string
|
15
|
+
attribute :type, :string
|
16
|
+
attribute :title, :string, collection: true
|
17
|
+
attribute :sub_title, :string, collection: true
|
18
|
+
attribute :part_number, :string, collection: true
|
19
|
+
attribute :part_name, :string, collection: true
|
20
|
+
attribute :non_sort, :string, collection: true
|
21
21
|
|
22
22
|
xml do
|
23
23
|
root "subjectTitleInfo"
|
@@ -1,16 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require "lutaml/model"
|
4
4
|
|
5
5
|
module LocMods
|
6
|
-
class TableOfContents <
|
7
|
-
attribute :content,
|
8
|
-
attribute :display_label,
|
9
|
-
attribute :type,
|
10
|
-
attribute :shareable,
|
11
|
-
attribute :alt_rep_group,
|
12
|
-
attribute :alt_format,
|
13
|
-
attribute :content_type,
|
6
|
+
class TableOfContents < Lutaml::Model::Serializable
|
7
|
+
attribute :content, :string
|
8
|
+
attribute :display_label, :string
|
9
|
+
attribute :type, :string
|
10
|
+
attribute :shareable, :string
|
11
|
+
attribute :alt_rep_group, :string
|
12
|
+
attribute :alt_format, :string
|
13
|
+
attribute :content_type, :string
|
14
14
|
|
15
15
|
xml do
|
16
16
|
root "tableOfContents"
|
@@ -1,18 +1,20 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require "lutaml/model"
|
4
4
|
|
5
5
|
module LocMods
|
6
|
-
class TargetAudience <
|
7
|
-
attribute :content,
|
8
|
-
attribute :
|
9
|
-
attribute :
|
6
|
+
class TargetAudience < Lutaml::Model::Serializable
|
7
|
+
attribute :content, :string
|
8
|
+
attribute :authority, :string
|
9
|
+
attribute :display_label, :string
|
10
|
+
attribute :alt_rep_group, :string
|
10
11
|
|
11
12
|
xml do
|
12
13
|
root "targetAudience"
|
13
14
|
namespace "http://www.loc.gov/mods/v3", nil
|
14
15
|
|
15
16
|
map_content to: :content
|
17
|
+
map_attribute "authority", to: :authority
|
16
18
|
map_attribute "displayLabel", to: :display_label
|
17
19
|
map_attribute "altRepGroup", to: :alt_rep_group
|
18
20
|
end
|
data/lib/loc_mods/temporal.rb
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require "lutaml/model"
|
4
4
|
|
5
5
|
require_relative "date"
|
6
6
|
|
7
7
|
module LocMods
|
8
|
-
class Temporal <
|
8
|
+
class Temporal < Lutaml::Model::Serializable
|
9
9
|
attribute :content, Date
|
10
|
-
attribute :authority,
|
11
|
-
attribute :authority_uri,
|
12
|
-
attribute :value_uri,
|
10
|
+
attribute :authority, :string
|
11
|
+
attribute :authority_uri, :string
|
12
|
+
attribute :value_uri, :string
|
13
13
|
|
14
14
|
xml do
|
15
15
|
root "temporal"
|
data/lib/loc_mods/text.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require "lutaml/model"
|
4
4
|
|
5
5
|
module LocMods
|
6
|
-
class Text <
|
7
|
-
attribute :content,
|
8
|
-
attribute :display_label,
|
9
|
-
attribute :type,
|
6
|
+
class Text < Lutaml::Model::Serializable
|
7
|
+
attribute :content, :string
|
8
|
+
attribute :display_label, :string
|
9
|
+
attribute :type, :string
|
10
10
|
|
11
11
|
xml do
|
12
12
|
root "text"
|
data/lib/loc_mods/title_info.rb
CHANGED
@@ -1,30 +1,30 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require "lutaml/model"
|
4
4
|
require_relative "non_sort"
|
5
5
|
|
6
6
|
module LocMods
|
7
|
-
class TitleInfo <
|
8
|
-
attribute :type,
|
9
|
-
attribute :other_type,
|
10
|
-
attribute :supplied,
|
11
|
-
attribute :alt_rep_group,
|
12
|
-
attribute :alt_format,
|
13
|
-
attribute :content_type,
|
14
|
-
attribute :name_title_group,
|
15
|
-
attribute :usage,
|
16
|
-
attribute :id,
|
17
|
-
attribute :authority,
|
18
|
-
attribute :authority_uri,
|
19
|
-
attribute :value_uri,
|
20
|
-
attribute :lang,
|
21
|
-
attribute :script,
|
22
|
-
attribute :transliteration,
|
23
|
-
attribute :display_label,
|
24
|
-
attribute :title,
|
25
|
-
attribute :sub_title,
|
26
|
-
attribute :part_number,
|
27
|
-
attribute :part_name,
|
7
|
+
class TitleInfo < Lutaml::Model::Serializable
|
8
|
+
attribute :type, :string
|
9
|
+
attribute :other_type, :string
|
10
|
+
attribute :supplied, :string
|
11
|
+
attribute :alt_rep_group, :string
|
12
|
+
attribute :alt_format, :string
|
13
|
+
attribute :content_type, :string
|
14
|
+
attribute :name_title_group, :string
|
15
|
+
attribute :usage, :string
|
16
|
+
attribute :id, :string
|
17
|
+
attribute :authority, :string
|
18
|
+
attribute :authority_uri, :string
|
19
|
+
attribute :value_uri, :string
|
20
|
+
attribute :lang, :string
|
21
|
+
attribute :script, :string
|
22
|
+
attribute :transliteration, :string
|
23
|
+
attribute :display_label, :string
|
24
|
+
attribute :title, :string, collection: true
|
25
|
+
attribute :sub_title, :string, collection: true
|
26
|
+
attribute :part_number, :string, collection: true
|
27
|
+
attribute :part_name, :string, collection: true
|
28
28
|
attribute :non_sort, NonSort, collection: true
|
29
29
|
|
30
30
|
xml do
|
@@ -1,15 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require "lutaml/model"
|
4
4
|
|
5
5
|
module LocMods
|
6
|
-
class TypeOfResource <
|
7
|
-
attribute :content,
|
8
|
-
attribute :collection,
|
9
|
-
attribute :manuscript,
|
10
|
-
attribute :display_label,
|
11
|
-
attribute :alt_rep_group,
|
12
|
-
attribute :usage,
|
6
|
+
class TypeOfResource < Lutaml::Model::Serializable
|
7
|
+
attribute :content, :string
|
8
|
+
attribute :collection, :string
|
9
|
+
attribute :manuscript, :string
|
10
|
+
attribute :display_label, :string
|
11
|
+
attribute :alt_rep_group, :string
|
12
|
+
attribute :usage, :string
|
13
13
|
|
14
14
|
xml do
|
15
15
|
root "typeOfResource"
|
data/lib/loc_mods/url.rb
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require "lutaml/model"
|
4
4
|
|
5
5
|
module LocMods
|
6
|
-
class Url <
|
7
|
-
attribute :content,
|
8
|
-
attribute :date_last_accessed,
|
9
|
-
attribute :display_label,
|
10
|
-
attribute :note,
|
11
|
-
attribute :access,
|
12
|
-
attribute :usage,
|
6
|
+
class Url < Lutaml::Model::Serializable
|
7
|
+
attribute :content, :string
|
8
|
+
attribute :date_last_accessed, :string
|
9
|
+
attribute :display_label, :string
|
10
|
+
attribute :note, :string
|
11
|
+
attribute :access, :string
|
12
|
+
attribute :usage, :string
|
13
13
|
|
14
14
|
xml do
|
15
15
|
root "url"
|
data/lib/loc_mods/version.rb
CHANGED
data/lib/loc_mods.rb
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require "lutaml/model"
|
4
|
+
|
5
|
+
Lutaml::Model::Config.configure do |config|
|
6
|
+
require "lutaml/model/xml_adapter/nokogiri_adapter"
|
7
|
+
config.xml_adapter = Lutaml::Model::XmlAdapter::NokogiriAdapter
|
8
|
+
end
|
4
9
|
|
5
10
|
module LocMods
|
6
11
|
class Error < StandardError; end
|
7
|
-
# Your code goes here...
|
8
12
|
end
|
9
13
|
|
10
|
-
|
11
|
-
require "shale/adapter/nokogiri"
|
12
|
-
Shale.xml_adapter = Shale::Adapter::Nokogiri
|
13
|
-
|
14
|
+
require_relative "loc_mods/version"
|
14
15
|
require_relative "loc_mods/collection"
|
metadata
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: loc_mods
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: lutaml-model
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
@@ -25,7 +25,7 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: nokogiri
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
@@ -132,6 +132,7 @@ extra_rdoc_files: []
|
|
132
132
|
files:
|
133
133
|
- ".rspec"
|
134
134
|
- ".rubocop.yml"
|
135
|
+
- ".rubocop_todo.yml"
|
135
136
|
- CODE_OF_CONDUCT.md
|
136
137
|
- README.adoc
|
137
138
|
- Rakefile
|
@@ -141,14 +142,12 @@ files:
|
|
141
142
|
- lib/loc_mods/access_condition.rb
|
142
143
|
- lib/loc_mods/alternative_name.rb
|
143
144
|
- lib/loc_mods/area.rb
|
144
|
-
- lib/loc_mods/base_mapper.rb
|
145
145
|
- lib/loc_mods/cartographic_extension.rb
|
146
146
|
- lib/loc_mods/cartographics.rb
|
147
147
|
- lib/loc_mods/city_section.rb
|
148
148
|
- lib/loc_mods/classification.rb
|
149
149
|
- lib/loc_mods/cli.rb
|
150
150
|
- lib/loc_mods/collection.rb
|
151
|
-
- lib/loc_mods/comparable_mapper.rb
|
152
151
|
- lib/loc_mods/copy_information.rb
|
153
152
|
- lib/loc_mods/date.rb
|
154
153
|
- lib/loc_mods/date_other.rb
|
@@ -215,7 +214,7 @@ metadata:
|
|
215
214
|
homepage_uri: https://github.com/relaton/loc_mods
|
216
215
|
source_code_uri: https://github.com/relaton/loc_mods
|
217
216
|
changelog_uri: https://github.com/relaton/loc_mods
|
218
|
-
post_install_message:
|
217
|
+
post_install_message:
|
219
218
|
rdoc_options: []
|
220
219
|
require_paths:
|
221
220
|
- lib
|
@@ -231,7 +230,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
231
230
|
version: '0'
|
232
231
|
requirements: []
|
233
232
|
rubygems_version: 3.3.27
|
234
|
-
signing_key:
|
233
|
+
signing_key:
|
235
234
|
specification_version: 4
|
236
235
|
summary: Library of Congress MODS / MADS parser
|
237
236
|
test_files: []
|
data/lib/loc_mods/base_mapper.rb
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# lib/loc_mods/base_mapper.rb
|
4
|
-
require "shale"
|
5
|
-
require_relative "comparable_mapper"
|
6
|
-
|
7
|
-
module LocMods
|
8
|
-
# Base class for all object definitions
|
9
|
-
class BaseMapper < Shale::Mapper
|
10
|
-
include ComparableMapper
|
11
|
-
end
|
12
|
-
|
13
|
-
# Nil class substitute for comparison
|
14
|
-
class ComparableNil < BaseMapper
|
15
|
-
end
|
16
|
-
|
17
|
-
# Comparison of two values for ComparableMapper
|
18
|
-
class Comparison
|
19
|
-
attr_accessor :original, :updated
|
20
|
-
|
21
|
-
def initialize(original:, updated:)
|
22
|
-
@original = original
|
23
|
-
@updated = updated
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|