relaton-bib 2.1.6 → 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/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
|
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
|