relaton-bib 2.1.9 → 2.2.0.pre.alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/integration-tests.yml +1 -1
- data/CLAUDE.md +0 -12
- data/Gemfile +8 -0
- data/lib/relaton/bib/model/bibdata.rb +2 -0
- data/lib/relaton/bib/model/bibdata_shared.rb +2 -0
- data/lib/relaton/bib/model/bibitem.rb +2 -0
- data/lib/relaton/bib/model/bibitem_shared.rb +2 -0
- data/lib/relaton/bib/model/contact.rb +4 -0
- data/lib/relaton/bib/model/contribution_info.rb +0 -1
- data/lib/relaton/bib/model/date.rb +2 -0
- data/lib/relaton/bib/model/ext.rb +4 -0
- data/lib/relaton/bib/model/item.rb +55 -3
- data/lib/relaton/bib/model/organization.rb +2 -0
- data/lib/relaton/bib/model/organization_type.rb +2 -0
- data/lib/relaton/bib/model/relation.rb +3 -1
- data/lib/relaton/bib/model/series.rb +2 -0
- data/lib/relaton/bib/sanitizer.rb +6 -148
- data/lib/relaton/bib/version.rb +1 -1
- data/lib/relaton/bib.rb +10 -3
- data/relaton-bib.gemspec +3 -3
- metadata +7 -9
- data/.rubocop.yml +0 -12
- data/lib/relaton/bib/model_autoload.rb +0 -85
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 005ae3e4ad7104f88e115627ff44e82c26afbaec99dbd1c04bd77c2be213f23c
|
|
4
|
+
data.tar.gz: b642e93b937488eb3c488a6a29608b85838e4ec8a34ef9cdcebd9fa83115aa4c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6a7b248bd8ebb71d15f822bea93dec43df8ebca9a2cefad902aba469252c6a1bc94fabda8f68f42172e90d57c4214af5169a06b0a97e038a4e6861938d62acb6
|
|
7
|
+
data.tar.gz: beaed5fafb6a6960645dc13967cf2438f8eb652c65973620ed596600245adce9d0de0c45a5f3a97d7bededa53c412d62cb624401176e7fb43713f4059f087ae6
|
data/CLAUDE.md
CHANGED
|
@@ -37,18 +37,6 @@ bin/console
|
|
|
37
37
|
|
|
38
38
|
The codebase uses [lutaml-model](https://github.com/lutaml/lutaml-model) for serialization. Each model class in `lib/relaton/bib/model/` inherits from `Lutaml::Model::Serializable` and declares attributes with XML/YAML/JSON mappings.
|
|
39
39
|
|
|
40
|
-
### Constant loading (autoload)
|
|
41
|
-
|
|
42
|
-
Model and converter constants are wired via Ruby `autoload` from a central manifest,
|
|
43
|
-
[lib/relaton/bib/model_autoload.rb](lib/relaton/bib/model_autoload.rb). This makes load order
|
|
44
|
-
irrelevant and avoids circular requires between mutually-referencing classes (e.g. `OrganizationType`
|
|
45
|
-
↔ `Subdivision`). **When adding a new model class, add an `autoload` entry to the manifest** rather
|
|
46
|
-
than a `require_relative` in a sibling file. The manifest also eagerly loads `lutaml/model`/`lutaml/xml`
|
|
47
|
-
and runs the `Lutaml::Model::Config.configure` block so the XML adapter is set regardless of which
|
|
48
|
-
class is referenced first. Exceptions that keep `require_relative`: files that only *reopen* an
|
|
49
|
-
already-defined module to add methods (the converter method-partials under
|
|
50
|
-
`lib/relaton/bib/converter/*/`), which `autoload` cannot express.
|
|
51
|
-
|
|
52
40
|
### Core Classes
|
|
53
41
|
|
|
54
42
|
**`Relaton::Bib::Item`** ([lib/relaton/bib/model/item.rb](lib/relaton/bib/model/item.rb)) - The main serialization class defining all bibliographic attributes and their XML mappings. Uses `ItemData` as its underlying model.
|
data/Gemfile
CHANGED
|
@@ -3,6 +3,14 @@ source "https://rubygems.org"
|
|
|
3
3
|
# Specify your gem's dependencies in relaton-bib.gemspec
|
|
4
4
|
gemspec
|
|
5
5
|
|
|
6
|
+
# Use local monorepo sibling gems where available.
|
|
7
|
+
Dir["../*/"].each do |dir|
|
|
8
|
+
name = File.basename(dir)
|
|
9
|
+
next if name == File.basename(__dir__)
|
|
10
|
+
next unless File.exist?(File.join(dir, "#{name}.gemspec"))
|
|
11
|
+
gem name, path: dir
|
|
12
|
+
end
|
|
13
|
+
|
|
6
14
|
gem "byebug"
|
|
7
15
|
gem "equivalent-xml", "~> 0.6"
|
|
8
16
|
gem "openssl", "~> 3.3.2" # 3.3.0 raises error when rubocop fetches https resources
|
|
@@ -1,8 +1,60 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
require "lutaml/model"
|
|
2
|
+
require "lutaml/xml"
|
|
3
|
+
|
|
4
|
+
# lutaml/xml registers :doctype as an attr_accessor on Serializable (for the
|
|
5
|
+
# <!DOCTYPE …> XML declaration) and adds it to the override-warning list.
|
|
6
|
+
# Relaton's :doctype attribute models the document-type field
|
|
7
|
+
# (international-standard, technical-report, …); the override is intentional.
|
|
8
|
+
Lutaml::Model::Attribute.format_specific_warn_names.delete(:doctype)
|
|
9
|
+
|
|
10
|
+
require_relative "localized_string_attrs"
|
|
11
|
+
require_relative "localized_string"
|
|
12
|
+
require_relative "formattedref"
|
|
13
|
+
require_relative "abstract"
|
|
14
|
+
require_relative "date"
|
|
15
|
+
require_relative "locality"
|
|
16
|
+
require_relative "locality_stack"
|
|
17
|
+
require_relative "image"
|
|
18
|
+
require_relative "title"
|
|
19
|
+
require_relative "docidentifier"
|
|
20
|
+
require_relative "note"
|
|
21
|
+
require_relative "full_name_type"
|
|
22
|
+
require_relative "fullname"
|
|
23
|
+
require_relative "contact"
|
|
24
|
+
require_relative "logo"
|
|
25
|
+
require_relative "organization"
|
|
26
|
+
require_relative "affiliation"
|
|
27
|
+
require_relative "person"
|
|
28
|
+
require_relative "contribution_info"
|
|
29
|
+
require_relative "contributor"
|
|
30
|
+
require_relative "edition"
|
|
31
|
+
require_relative "version"
|
|
32
|
+
require_relative "status"
|
|
33
|
+
require_relative "copyright"
|
|
34
|
+
require_relative "place"
|
|
35
|
+
require_relative "series"
|
|
36
|
+
require_relative "medium"
|
|
37
|
+
require_relative "uri"
|
|
38
|
+
require_relative "price"
|
|
39
|
+
require_relative "extent"
|
|
40
|
+
require_relative "size"
|
|
41
|
+
require_relative "keyword"
|
|
42
|
+
require_relative "validity"
|
|
43
|
+
require_relative "depiction"
|
|
44
|
+
require_relative "source_locality_stack"
|
|
45
|
+
require_relative "ext"
|
|
46
|
+
require_relative "item_shared"
|
|
47
|
+
require_relative "type/plain_date"
|
|
48
|
+
|
|
49
|
+
Lutaml::Model::Config.configure do |config|
|
|
50
|
+
config.xml_adapter_type = :nokogiri
|
|
51
|
+
end
|
|
52
|
+
|
|
4
53
|
module Relaton
|
|
5
54
|
module Bib
|
|
55
|
+
class Relation < Lutaml::Model::Serializable
|
|
56
|
+
end
|
|
57
|
+
|
|
6
58
|
# Item class repesents bibliographic item metadata.
|
|
7
59
|
# Used for YAML/JSON parsing and as the XML dispatch entry point.
|
|
8
60
|
class Item < Lutaml::Model::Serializable
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
require_relative "item_base"
|
|
2
|
+
|
|
1
3
|
module Relaton
|
|
2
4
|
module Bib
|
|
3
|
-
class Relation
|
|
5
|
+
class Relation
|
|
4
6
|
attribute :type, :string, values: %w[
|
|
5
7
|
includes includedIn hasPart partOf merges mergedInto splits splitInto
|
|
6
8
|
instanceOf hasInstance exemplarOf hasExemplar manifestationOf
|
|
@@ -3,14 +3,8 @@ require "nokogiri"
|
|
|
3
3
|
module Relaton
|
|
4
4
|
module Bib
|
|
5
5
|
# Strips inline markup not in the basicdoc PureTextElement set
|
|
6
|
-
# (plus <p>, <eref>, <xref>, <fn
|
|
7
|
-
#
|
|
8
|
-
# kept.
|
|
9
|
-
#
|
|
10
|
-
# <link> is admitted because basicdoc expresses external hyperlinks as
|
|
11
|
-
# <link target="...">; without it a from_xml -> to_xml round-trip drops
|
|
12
|
-
# the tag and its target URL, keeping only the link text (see #122,
|
|
13
|
-
# which broke metanorma amend()).
|
|
6
|
+
# (plus <p>, <eref>, <xref>, <fn>) from raw marked-up content strings.
|
|
7
|
+
# Disallowed elements are unwrapped: tags removed, inner text kept.
|
|
14
8
|
#
|
|
15
9
|
# <fn> is admitted beyond strict PureTextElement because bibliographic
|
|
16
10
|
# titles in real Metanorma input routinely carry footnotes (e.g. ISO
|
|
@@ -28,7 +22,7 @@ module Relaton
|
|
|
28
22
|
module Sanitizer
|
|
29
23
|
ALLOWED = %w[
|
|
30
24
|
em strong sub sup tt underline strike smallcap br stem
|
|
31
|
-
p eref xref fn
|
|
25
|
+
p eref xref fn
|
|
32
26
|
].freeze
|
|
33
27
|
|
|
34
28
|
# Elements whose children are non-basicdoc inline notation
|
|
@@ -42,151 +36,15 @@ module Relaton
|
|
|
42
36
|
|
|
43
37
|
TAG_RX = %r{<[a-zA-Z/!?]}
|
|
44
38
|
|
|
45
|
-
# Captures a namespace prefix, on a tag or on an attribute: the
|
|
46
|
-
# "jats" of <jats:p> and </jats:italic>, and the "xlink" of
|
|
47
|
-
# xlink:href.
|
|
48
|
-
NS_PREFIX_RX = %r{(?:</?|\s)([A-Za-z_][\w.-]*):(?=[A-Za-z_])}
|
|
49
|
-
|
|
50
|
-
# Namespace that declares a prefix which the content leaves
|
|
51
|
-
# undeclared. The sanitiser removes it again before it serialises.
|
|
52
|
-
NS_PLACEHOLDER = "urn:x-relaton-undeclared:%s".freeze
|
|
53
|
-
|
|
54
|
-
# Element that carries the placeholder declarations. Its children
|
|
55
|
-
# are the sanitised content, so the element itself never reaches
|
|
56
|
-
# the output.
|
|
57
|
-
NS_WRAPPER = "relaton-sanitizer-root".freeze
|
|
58
|
-
|
|
59
|
-
# Reserved prefixes. XML declares both, so the content must not.
|
|
60
|
-
NS_RESERVED = %w[xml xmlns].freeze
|
|
61
|
-
|
|
62
|
-
# Serialise without the FORMAT option, so the sanitiser keeps the
|
|
63
|
-
# shape of element-only content instead of adding newlines and
|
|
64
|
-
# indent.
|
|
65
|
-
SAVE_OPTS = Nokogiri::XML::Node::SaveOptions::AS_XML
|
|
66
|
-
|
|
67
39
|
def self.sanitize(content)
|
|
68
40
|
return content unless sanitizable?(content)
|
|
69
41
|
|
|
70
|
-
node = parse(content)
|
|
71
|
-
return content if node.nil?
|
|
72
|
-
|
|
73
|
-
sanitize_children(node)
|
|
74
|
-
node.children.map do |c|
|
|
75
|
-
c.to_xml(encoding: "UTF-8", save_with: SAVE_OPTS)
|
|
76
|
-
end.join
|
|
77
|
-
end
|
|
78
|
-
|
|
79
|
-
#
|
|
80
|
-
# Parse the content into a node whose children are the content.
|
|
81
|
-
#
|
|
82
|
-
# @param [String] content The raw marked-up content.
|
|
83
|
-
#
|
|
84
|
-
# @return [Nokogiri::XML::Node, nil] The node, or nil when the
|
|
85
|
-
# content does not parse.
|
|
86
|
-
#
|
|
87
|
-
def self.parse(content)
|
|
88
42
|
fragment = Nokogiri::XML::DocumentFragment.parse(content)
|
|
89
|
-
return
|
|
90
|
-
|
|
91
|
-
parse_with_prefixes(content)
|
|
92
|
-
end
|
|
93
|
-
private_class_method :parse
|
|
43
|
+
return content if fragment.errors.any?
|
|
94
44
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
#
|
|
98
|
-
# An undeclared prefix is always a parse error, so without this the
|
|
99
|
-
# sanitiser gives up on exactly the third-party markup that needs
|
|
100
|
-
# sanitising most. Declare every prefix that the content uses on a
|
|
101
|
-
# wrapper element, parse, then remove the placeholder namespaces
|
|
102
|
-
# from the elements and from the attributes. See metanorma-pdfa#99.
|
|
103
|
-
#
|
|
104
|
-
# An undeclared prefix inside an OPAQUE <stem> goes as well. The
|
|
105
|
-
# sanitiser cannot keep it: an undeclared prefix in the output is
|
|
106
|
-
# the exact failure that this method removes. Only a namespace that
|
|
107
|
-
# the content declares itself survives verbatim.
|
|
108
|
-
#
|
|
109
|
-
# @param [String] content The raw marked-up content.
|
|
110
|
-
#
|
|
111
|
-
# @return [Nokogiri::XML::Element, nil] The wrapper element, or nil
|
|
112
|
-
# when the content uses no prefix or does not parse.
|
|
113
|
-
#
|
|
114
|
-
def self.parse_with_prefixes(content)
|
|
115
|
-
decl = placeholder_declarations(content) or return
|
|
116
|
-
name = wrapper_name(content)
|
|
117
|
-
doc = Nokogiri::XML "<#{name} #{decl}>#{content}</#{name}>"
|
|
118
|
-
return unless doc.errors.empty?
|
|
119
|
-
|
|
120
|
-
drop_placeholder_namespaces doc.root
|
|
121
|
-
end
|
|
122
|
-
private_class_method :parse_with_prefixes
|
|
123
|
-
|
|
124
|
-
#
|
|
125
|
-
# Declare every namespace prefix that the content uses.
|
|
126
|
-
#
|
|
127
|
-
# @param [String] content The raw marked-up content.
|
|
128
|
-
#
|
|
129
|
-
# @return [String, nil] The declarations, or nil when the content
|
|
130
|
-
# uses no prefix.
|
|
131
|
-
#
|
|
132
|
-
def self.placeholder_declarations(content)
|
|
133
|
-
prefixes = content.scan(NS_PREFIX_RX).flatten.uniq - NS_RESERVED
|
|
134
|
-
return if prefixes.empty?
|
|
135
|
-
|
|
136
|
-
prefixes.map do |pfx|
|
|
137
|
-
%(xmlns:#{pfx}="#{format NS_PLACEHOLDER, pfx}")
|
|
138
|
-
end.join(" ")
|
|
139
|
-
end
|
|
140
|
-
private_class_method :placeholder_declarations
|
|
141
|
-
|
|
142
|
-
#
|
|
143
|
-
# Name a wrapper element that the content does not close itself.
|
|
144
|
-
#
|
|
145
|
-
# Content that holds the literal end tag of the wrapper would close
|
|
146
|
-
# it early. The document then has more than one root, the parse
|
|
147
|
-
# fails, and the sanitiser gives up on content that it can handle.
|
|
148
|
-
#
|
|
149
|
-
# @param [String] content The raw marked-up content.
|
|
150
|
-
#
|
|
151
|
-
# @return [String] A name that the content does not contain.
|
|
152
|
-
#
|
|
153
|
-
def self.wrapper_name(content)
|
|
154
|
-
name = NS_WRAPPER
|
|
155
|
-
name += "-x" while content.include?(name)
|
|
156
|
-
name
|
|
157
|
-
end
|
|
158
|
-
private_class_method :wrapper_name
|
|
159
|
-
|
|
160
|
-
#
|
|
161
|
-
# Remove the placeholder namespaces, and only those.
|
|
162
|
-
#
|
|
163
|
-
# Nokogiri's remove_namespaces! would also strip a namespace that
|
|
164
|
-
# the content declares itself, such as the MathML xmlns inside an
|
|
165
|
-
# OPAQUE <stem>, which must survive verbatim. Match the wrapper's
|
|
166
|
-
# own declarations, so a namespace of the content never matches,
|
|
167
|
-
# whatever its URI.
|
|
168
|
-
#
|
|
169
|
-
# The declarations stay on the wrapper element. Only its children
|
|
170
|
-
# reach the output, so the declarations never leak. Do not
|
|
171
|
-
# serialise the root itself.
|
|
172
|
-
#
|
|
173
|
-
# @param [Nokogiri::XML::Element] root The wrapper element.
|
|
174
|
-
#
|
|
175
|
-
# @return [Nokogiri::XML::Element] The same element.
|
|
176
|
-
#
|
|
177
|
-
def self.drop_placeholder_namespaces(root)
|
|
178
|
-
placeholders = root.namespace_definitions
|
|
179
|
-
root.traverse do |node|
|
|
180
|
-
node.namespace = nil if placeholders.include?(node.namespace)
|
|
181
|
-
next unless node.element?
|
|
182
|
-
|
|
183
|
-
node.attribute_nodes.each do |attr|
|
|
184
|
-
attr.namespace = nil if placeholders.include?(attr.namespace)
|
|
185
|
-
end
|
|
186
|
-
end
|
|
187
|
-
root
|
|
45
|
+
sanitize_children(fragment)
|
|
46
|
+
fragment.children.map { |c| c.to_xml(encoding: "UTF-8") }.join
|
|
188
47
|
end
|
|
189
|
-
private_class_method :drop_placeholder_namespaces
|
|
190
48
|
|
|
191
49
|
def self.sanitizable?(content)
|
|
192
50
|
content.is_a?(::String) && !content.empty? && content.match?(TAG_RX)
|
data/lib/relaton/bib/version.rb
CHANGED
data/lib/relaton/bib.rb
CHANGED
|
@@ -9,10 +9,17 @@ require_relative "bib/version"
|
|
|
9
9
|
require_relative "bib/util"
|
|
10
10
|
require_relative "bib/sanitizer"
|
|
11
11
|
require_relative "bib/namespace_helper"
|
|
12
|
-
# Model and converter classes are wired via autoload (see model_autoload.rb) so
|
|
13
|
-
# that load order is irrelevant and mutually-referencing classes resolve lazily.
|
|
14
|
-
require_relative "bib/model_autoload"
|
|
15
12
|
require_relative "bib/item_data"
|
|
13
|
+
require_relative "bib/model/item"
|
|
14
|
+
require_relative "bib/model/item_base"
|
|
15
|
+
require_relative "bib/model/bibitem_shared"
|
|
16
|
+
require_relative "bib/model/bibdata_shared"
|
|
17
|
+
require_relative "bib/model/bibitem"
|
|
18
|
+
require_relative "bib/model/bibdata"
|
|
19
|
+
require_relative "bib/converter/bibxml"
|
|
20
|
+
require_relative "bib/converter/bibtex"
|
|
21
|
+
require_relative "bib/converter/asciibib"
|
|
22
|
+
require_relative "bib/model/relation"
|
|
16
23
|
|
|
17
24
|
module Relaton
|
|
18
25
|
# class Error < StandardError; end
|
data/relaton-bib.gemspec
CHANGED
|
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
|
|
|
21
21
|
spec.bindir = "exe"
|
|
22
22
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
23
23
|
spec.require_paths = ["lib"]
|
|
24
|
-
spec.required_ruby_version = Gem::Requirement.new(">= 3.
|
|
24
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 3.3.0")
|
|
25
25
|
|
|
26
26
|
spec.add_dependency "bibtex-ruby"
|
|
27
27
|
spec.add_dependency "iso639"
|
|
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
|
|
|
29
29
|
spec.add_dependency "lutaml-model", "~> 0.8.0"
|
|
30
30
|
spec.add_dependency "nokogiri", ">= 1.16"
|
|
31
31
|
spec.add_dependency "psych", "~> 5.2.0" # versin 5.3.0 crashes
|
|
32
|
-
spec.add_dependency "relaton-core", "~>
|
|
33
|
-
spec.add_dependency "relaton-logger", "~>
|
|
32
|
+
spec.add_dependency "relaton-core", "~> 2.2.0.pre.alpha.1"
|
|
33
|
+
spec.add_dependency "relaton-logger", "~> 2.2.0.pre.alpha.1"
|
|
34
34
|
spec.add_dependency "rfcxml", "~> 0.4.3"
|
|
35
35
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: relaton-bib
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.1
|
|
4
|
+
version: 2.2.0.pre.alpha.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-06-26 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bibtex-ruby
|
|
@@ -100,28 +100,28 @@ dependencies:
|
|
|
100
100
|
requirements:
|
|
101
101
|
- - "~>"
|
|
102
102
|
- !ruby/object:Gem::Version
|
|
103
|
-
version:
|
|
103
|
+
version: 2.2.0.pre.alpha.1
|
|
104
104
|
type: :runtime
|
|
105
105
|
prerelease: false
|
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
|
107
107
|
requirements:
|
|
108
108
|
- - "~>"
|
|
109
109
|
- !ruby/object:Gem::Version
|
|
110
|
-
version:
|
|
110
|
+
version: 2.2.0.pre.alpha.1
|
|
111
111
|
- !ruby/object:Gem::Dependency
|
|
112
112
|
name: relaton-logger
|
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
|
114
114
|
requirements:
|
|
115
115
|
- - "~>"
|
|
116
116
|
- !ruby/object:Gem::Version
|
|
117
|
-
version:
|
|
117
|
+
version: 2.2.0.pre.alpha.1
|
|
118
118
|
type: :runtime
|
|
119
119
|
prerelease: false
|
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
|
121
121
|
requirements:
|
|
122
122
|
- - "~>"
|
|
123
123
|
- !ruby/object:Gem::Version
|
|
124
|
-
version:
|
|
124
|
+
version: 2.2.0.pre.alpha.1
|
|
125
125
|
- !ruby/object:Gem::Dependency
|
|
126
126
|
name: rfcxml
|
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -150,7 +150,6 @@ files:
|
|
|
150
150
|
- ".gitmodules"
|
|
151
151
|
- ".hound.yml"
|
|
152
152
|
- ".rspec"
|
|
153
|
-
- ".rubocop.yml"
|
|
154
153
|
- CLAUDE.md
|
|
155
154
|
- Gemfile
|
|
156
155
|
- LICENSE.txt
|
|
@@ -226,7 +225,6 @@ files:
|
|
|
226
225
|
- lib/relaton/bib/model/uri.rb
|
|
227
226
|
- lib/relaton/bib/model/validity.rb
|
|
228
227
|
- lib/relaton/bib/model/version.rb
|
|
229
|
-
- lib/relaton/bib/model_autoload.rb
|
|
230
228
|
- lib/relaton/bib/namespace_helper.rb
|
|
231
229
|
- lib/relaton/bib/sanitizer.rb
|
|
232
230
|
- lib/relaton/bib/util.rb
|
|
@@ -245,7 +243,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
245
243
|
requirements:
|
|
246
244
|
- - ">="
|
|
247
245
|
- !ruby/object:Gem::Version
|
|
248
|
-
version: 3.
|
|
246
|
+
version: 3.3.0
|
|
249
247
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
250
248
|
requirements:
|
|
251
249
|
- - ">="
|
data/.rubocop.yml
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
# This project follows the Ribose OSS style guide.
|
|
2
|
-
# https://github.com/riboseinc/oss-guides
|
|
3
|
-
# All project-specific additions and overrides should be specified in this file.
|
|
4
|
-
|
|
5
|
-
require: rubocop-rails
|
|
6
|
-
|
|
7
|
-
inherit_from:
|
|
8
|
-
- https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
|
|
9
|
-
AllCops:
|
|
10
|
-
TargetRubyVersion: 3.2
|
|
11
|
-
Rails:
|
|
12
|
-
Enabled: false
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
# Central autoload manifest for the model + converter layer.
|
|
2
|
-
#
|
|
3
|
-
# Declaring these as autoloads (instead of a require_relative chain) makes load
|
|
4
|
-
# order irrelevant and removes the circular require between OrganizationType and
|
|
5
|
-
# Subdivision (issue #120): a constant is loaded on first reference rather than
|
|
6
|
-
# at file-load time, so mutually-referencing classes resolve each other lazily.
|
|
7
|
-
#
|
|
8
|
-
# lutaml-model must be available before the first model autoload fires, and the
|
|
9
|
-
# XML adapter must be configured eagerly here (not inside item.rb) so that
|
|
10
|
-
# serializing through any model class works regardless of which one is
|
|
11
|
-
# referenced first.
|
|
12
|
-
require "lutaml/model"
|
|
13
|
-
require "lutaml/xml"
|
|
14
|
-
|
|
15
|
-
Lutaml::Model::Config.configure do |config|
|
|
16
|
-
config.xml_adapter_type = :nokogiri
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
module Relaton
|
|
20
|
-
module Bib
|
|
21
|
-
autoload :Abstract, "relaton/bib/model/abstract"
|
|
22
|
-
autoload :Address, "relaton/bib/model/address"
|
|
23
|
-
autoload :Affiliation, "relaton/bib/model/affiliation"
|
|
24
|
-
autoload :Bibdata, "relaton/bib/model/bibdata"
|
|
25
|
-
autoload :BibdataShared, "relaton/bib/model/bibdata_shared"
|
|
26
|
-
autoload :Bibitem, "relaton/bib/model/bibitem"
|
|
27
|
-
autoload :BibitemShared, "relaton/bib/model/bibitem_shared"
|
|
28
|
-
autoload :Contact, "relaton/bib/model/contact"
|
|
29
|
-
autoload :ContributionInfo, "relaton/bib/model/contribution_info"
|
|
30
|
-
autoload :Contributor, "relaton/bib/model/contributor"
|
|
31
|
-
autoload :Copyright, "relaton/bib/model/copyright"
|
|
32
|
-
autoload :Date, "relaton/bib/model/date"
|
|
33
|
-
autoload :Depiction, "relaton/bib/model/depiction"
|
|
34
|
-
autoload :Docidentifier, "relaton/bib/model/docidentifier"
|
|
35
|
-
autoload :Doctype, "relaton/bib/model/doctype"
|
|
36
|
-
autoload :Edition, "relaton/bib/model/edition"
|
|
37
|
-
autoload :Ext, "relaton/bib/model/ext"
|
|
38
|
-
autoload :Extent, "relaton/bib/model/extent"
|
|
39
|
-
autoload :Formattedref, "relaton/bib/model/formattedref"
|
|
40
|
-
autoload :FullName, "relaton/bib/model/fullname"
|
|
41
|
-
autoload :FullNameType, "relaton/bib/model/full_name_type"
|
|
42
|
-
autoload :ICS, "relaton/bib/model/ics"
|
|
43
|
-
autoload :Image, "relaton/bib/model/image"
|
|
44
|
-
autoload :Item, "relaton/bib/model/item"
|
|
45
|
-
autoload :ItemBase, "relaton/bib/model/item_base"
|
|
46
|
-
autoload :ItemShared, "relaton/bib/model/item_shared"
|
|
47
|
-
autoload :Keyword, "relaton/bib/model/keyword"
|
|
48
|
-
autoload :Locality, "relaton/bib/model/locality"
|
|
49
|
-
autoload :LocalityStack, "relaton/bib/model/locality_stack"
|
|
50
|
-
# localized_string.rb defines three top-level constants:
|
|
51
|
-
autoload :LocalizedString, "relaton/bib/model/localized_string"
|
|
52
|
-
autoload :TypedLocalizedString, "relaton/bib/model/localized_string"
|
|
53
|
-
autoload :LocalizedMarkedUpString, "relaton/bib/model/localized_string"
|
|
54
|
-
autoload :LocalizedStringAttrs, "relaton/bib/model/localized_string_attrs"
|
|
55
|
-
autoload :Logo, "relaton/bib/model/logo"
|
|
56
|
-
autoload :Medium, "relaton/bib/model/medium"
|
|
57
|
-
autoload :Note, "relaton/bib/model/note"
|
|
58
|
-
autoload :Organization, "relaton/bib/model/organization"
|
|
59
|
-
autoload :OrganizationType, "relaton/bib/model/organization_type"
|
|
60
|
-
autoload :Person, "relaton/bib/model/person"
|
|
61
|
-
autoload :Phone, "relaton/bib/model/phone"
|
|
62
|
-
autoload :Place, "relaton/bib/model/place"
|
|
63
|
-
# type/ is only a directory; these constants are top-level under Bib:
|
|
64
|
-
autoload :PlainDate, "relaton/bib/model/type/plain_date"
|
|
65
|
-
autoload :StringDate, "relaton/bib/model/type/string_date"
|
|
66
|
-
autoload :Price, "relaton/bib/model/price"
|
|
67
|
-
autoload :Relation, "relaton/bib/model/relation"
|
|
68
|
-
autoload :Series, "relaton/bib/model/series"
|
|
69
|
-
autoload :Size, "relaton/bib/model/size"
|
|
70
|
-
autoload :SourceLocalityStack, "relaton/bib/model/source_locality_stack"
|
|
71
|
-
autoload :Status, "relaton/bib/model/status"
|
|
72
|
-
autoload :StructuredIdentifier, "relaton/bib/model/structured_identifier"
|
|
73
|
-
autoload :Subdivision, "relaton/bib/model/subdivision"
|
|
74
|
-
autoload :Title, "relaton/bib/model/title"
|
|
75
|
-
autoload :Uri, "relaton/bib/model/uri"
|
|
76
|
-
autoload :Validity, "relaton/bib/model/validity"
|
|
77
|
-
autoload :Version, "relaton/bib/model/version"
|
|
78
|
-
|
|
79
|
-
module Converter
|
|
80
|
-
autoload :BibXml, "relaton/bib/converter/bibxml"
|
|
81
|
-
autoload :Bibtex, "relaton/bib/converter/bibtex"
|
|
82
|
-
autoload :Asciibib, "relaton/bib/converter/asciibib"
|
|
83
|
-
end
|
|
84
|
-
end
|
|
85
|
-
end
|