relaton 3.0.8 → 3.1.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/lib/relaton/3gpp/processor.rb +1 -1
- data/lib/relaton/3gpp.rb +3 -3
- data/lib/relaton/adobe/processor.rb +1 -1
- data/lib/relaton/adobe.rb +3 -3
- data/lib/relaton/bib/item_data.rb +2 -2
- data/lib/relaton/bib.rb +2 -2
- data/lib/relaton/bibcollection.rb +1 -1
- data/lib/relaton/bipm/processor.rb +1 -1
- data/lib/relaton/bipm.rb +3 -3
- data/lib/relaton/bsi/processor.rb +1 -1
- data/lib/relaton/bsi.rb +1 -1
- data/lib/relaton/calconnect/data_fetcher.rb +2 -2
- data/lib/relaton/calconnect/model/item.rb +1 -1
- data/lib/relaton/calconnect/processor.rb +1 -1
- data/lib/relaton/calconnect.rb +2 -2
- data/lib/relaton/ccsds/data/fetcher.rb +1 -1
- data/lib/relaton/ccsds/model/item.rb +1 -1
- data/lib/relaton/ccsds/processor.rb +1 -1
- data/lib/relaton/ccsds/util.rb +1 -1
- data/lib/relaton/ccsds.rb +1 -1
- data/lib/relaton/cen/processor.rb +1 -1
- data/lib/relaton/cen.rb +2 -2
- data/lib/relaton/cie/data_fetcher.rb +3 -3
- data/lib/relaton/cie/processor.rb +1 -1
- data/lib/relaton/cie.rb +2 -2
- data/lib/relaton/cli/base_convertor.rb +3 -3
- data/lib/relaton/cli/command.rb +19 -11
- data/lib/relaton/cli/index_site_generator.rb +34 -6
- data/lib/relaton/cli/relaton_file.rb +4 -4
- data/lib/relaton/cli/subcommand_collection.rb +1 -1
- data/lib/relaton/cli/xml_convertor.rb +1 -1
- data/lib/relaton/cli/yaml_convertor.rb +2 -2
- data/lib/relaton/cli.rb +1 -11
- data/lib/relaton/core/processor.rb +1 -1
- data/lib/relaton/core.rb +1 -1
- data/lib/relaton/db/registry.rb +1 -1
- data/lib/relaton/db.rb +1 -1
- data/lib/relaton/doi/parser.rb +2 -1
- data/lib/relaton/doi/processor.rb +1 -1
- data/lib/relaton/doi.rb +4 -4
- data/lib/relaton/easc/processor.rb +1 -1
- data/lib/relaton/easc.rb +3 -3
- data/lib/relaton/ecma/data_fetcher.rb +1 -1
- data/lib/relaton/ecma/processor.rb +1 -1
- data/lib/relaton/ecma.rb +2 -2
- data/lib/relaton/etsi/data_fetcher.rb +2 -2
- data/lib/relaton/etsi/item.rb +1 -1
- data/lib/relaton/etsi/processor.rb +2 -2
- data/lib/relaton/etsi.rb +1 -1
- data/lib/relaton/evs/processor.rb +1 -1
- data/lib/relaton/evs.rb +2 -2
- data/lib/relaton/gb/bibliography.rb +1 -1
- data/lib/relaton/gb/processor.rb +1 -1
- data/lib/relaton/gb.rb +2 -2
- data/lib/relaton/gost/processor.rb +1 -1
- data/lib/relaton/gost.rb +3 -3
- data/lib/relaton/iala/processor.rb +1 -1
- data/lib/relaton/iala.rb +3 -3
- data/lib/relaton/iana/data_fetcher.rb +1 -1
- data/lib/relaton/iana/processor.rb +1 -1
- data/lib/relaton/iana.rb +2 -2
- data/lib/relaton/iec/bibliography.rb +32 -20
- data/lib/relaton/iec/data_fetcher.rb +1 -1
- data/lib/relaton/iec/processor.rb +1 -1
- data/lib/relaton/iec.rb +2 -2
- data/lib/relaton/ieee/processor.rb +1 -1
- data/lib/relaton/ieee.rb +2 -2
- data/lib/relaton/ietf/data_fetcher.rb +1 -1
- data/lib/relaton/ietf/processor.rb +1 -1
- data/lib/relaton/ietf.rb +2 -2
- data/lib/relaton/iho/hash_parser_v1.rb +1 -1
- data/lib/relaton/iho/processor.rb +1 -1
- data/lib/relaton/iho.rb +2 -2
- data/lib/relaton/index.rb +1 -1
- data/lib/relaton/isbn/processor.rb +1 -1
- data/lib/relaton/isbn.rb +1 -1
- data/lib/relaton/iso/hash_parser_v1.rb +1 -1
- data/lib/relaton/iso/processor.rb +1 -1
- data/lib/relaton/iso.rb +3 -3
- data/lib/relaton/itu/processor.rb +1 -1
- data/lib/relaton/itu.rb +3 -3
- data/lib/relaton/jcgm/processor.rb +1 -1
- data/lib/relaton/jcgm.rb +2 -2
- data/lib/relaton/jis/processor.rb +1 -1
- data/lib/relaton/jis.rb +2 -2
- data/lib/relaton/nist/processor.rb +1 -1
- data/lib/relaton/nist.rb +2 -2
- data/lib/relaton/oasis/processor.rb +1 -1
- data/lib/relaton/oasis.rb +2 -2
- data/lib/relaton/ogc/processor.rb +1 -1
- data/lib/relaton/ogc.rb +2 -2
- data/lib/relaton/oiml/processor.rb +1 -1
- data/lib/relaton/oiml.rb +2 -2
- data/lib/relaton/omg/processor.rb +1 -1
- data/lib/relaton/omg.rb +1 -1
- data/lib/relaton/plateau/data_fetcher.rb +1 -1
- data/lib/relaton/plateau/processor.rb +1 -1
- data/lib/relaton/plateau.rb +2 -2
- data/lib/relaton/render/iso690/elements/extent.rb +1 -1
- data/lib/relaton/render.rb +17 -0
- data/lib/relaton/sae/CLAUDE.md +91 -0
- data/lib/relaton/sae/bibdata.rb +8 -0
- data/lib/relaton/sae/bibitem.rb +8 -0
- data/lib/relaton/sae/bibliography.rb +128 -0
- data/lib/relaton/sae/data_fetcher.rb +224 -0
- data/lib/relaton/sae/doi_code.rb +83 -0
- data/lib/relaton/sae/item.rb +10 -0
- data/lib/relaton/sae/item_data.rb +6 -0
- data/lib/relaton/sae/processor.rb +62 -0
- data/lib/relaton/sae/util.rb +9 -0
- data/lib/relaton/sae.rb +37 -0
- data/lib/relaton/un/processor.rb +1 -1
- data/lib/relaton/un.rb +1 -1
- data/lib/relaton/version.rb +1 -1
- data/lib/relaton/w3c/bibliography.rb +1 -1
- data/lib/relaton/w3c/data_fetcher.rb +1 -1
- data/lib/relaton/w3c/processor.rb +1 -1
- data/lib/relaton/w3c.rb +2 -2
- data/lib/relaton/xsf/data_fetcher.rb +1 -1
- data/lib/relaton/xsf/processor.rb +1 -1
- data/lib/relaton/xsf.rb +2 -2
- data/lib/relaton-cli.rb +2 -2
- data/lib/relaton-render.rb +4 -11
- data/lib/relaton.rb +3 -2
- metadata +18 -8
- data/lib/relaton/cli/version.rb +0 -11
- data/lib/relaton/render/version.rb +0 -5
data/lib/relaton/etsi.rb
CHANGED
data/lib/relaton/evs.rb
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
require "digest/md5"
|
|
4
4
|
require "mechanize"
|
|
5
|
-
|
|
5
|
+
require_relative "core"
|
|
6
6
|
require "isoics"
|
|
7
7
|
require "pubid"
|
|
8
|
-
|
|
8
|
+
require_relative "bib"
|
|
9
9
|
require_relative "version"
|
|
10
10
|
require_relative "evs/util"
|
|
11
11
|
require_relative "evs/model/item"
|
data/lib/relaton/gb/processor.rb
CHANGED
data/lib/relaton/gb.rb
CHANGED
data/lib/relaton/gost.rb
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
require_relative "bib"
|
|
4
|
+
require_relative "index"
|
|
5
5
|
require "pubid"
|
|
6
|
-
|
|
6
|
+
require_relative "version"
|
|
7
7
|
|
|
8
8
|
# Relaton::Gost is the GOST (Russian federal standards — Гостстандарт)
|
|
9
9
|
# flavor of the unified relaton gem. Adds typed Ext fields (urn,
|
data/lib/relaton/iala.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require "pubid"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
require_relative "bib"
|
|
3
|
+
require_relative "index"
|
|
4
|
+
require_relative "version"
|
|
5
5
|
|
|
6
6
|
# Relaton::Iala is the IALA (International Organization for Marine Aids
|
|
7
7
|
# to Navigation) flavor of the unified relaton gem. Adds typed Ext fields
|
data/lib/relaton/iana.rb
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require "faraday"
|
|
4
|
-
|
|
4
|
+
require_relative "index"
|
|
5
5
|
require "pubid"
|
|
6
|
-
|
|
6
|
+
require_relative "bib"
|
|
7
7
|
require_relative "version"
|
|
8
8
|
require_relative "iana/util"
|
|
9
9
|
require_relative "iana/item_data"
|
|
@@ -25,32 +25,30 @@ module Relaton
|
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
# @param ref [String, Pubid::Iec::Identifier] the IEC standard code to
|
|
28
|
-
# look up (e.g. "IEC 8000"), or the parse
|
|
29
|
-
# with (relaton#205); a pubid is never mutated
|
|
28
|
+
# look up (e.g. "IEC 8000", "IEC 80000 (all parts)"), or the parse
|
|
29
|
+
# that Relaton::Db routed with (relaton#205); a pubid is never mutated
|
|
30
30
|
# @param year [String] the year the standard was published (optional)
|
|
31
|
-
# @param opts [Hash] options;
|
|
32
|
-
# reference is
|
|
31
|
+
# @param opts [Hash] options; `:all_parts` asks for all parts of a
|
|
32
|
+
# reference that does not say so itself. The hash is not changed.
|
|
33
33
|
# @return [Relaton::Iec::ItemData, nil]
|
|
34
|
-
def get(ref, year = nil, opts = {}) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity
|
|
34
|
+
def get(ref, year = nil, opts = {}) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity
|
|
35
35
|
if ref.is_a?(String)
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
pubid = ::Pubid::Iec::Identifier.parse text.upcase
|
|
41
|
-
elsif ref.all_parts?
|
|
42
|
-
opts[:all_parts] = true
|
|
43
|
-
pubid = ref.identifiers.first
|
|
44
|
-
else
|
|
45
|
-
pubid = ref
|
|
36
|
+
return iev if ref.strip.casecmp?("IEV")
|
|
37
|
+
|
|
38
|
+
ref = parse_ref ref
|
|
46
39
|
end
|
|
40
|
+
# The pubid says whether all parts are asked for (relaton-iec#64):
|
|
41
|
+
# the option is folded into it, as Core::Processor#cache_key does.
|
|
42
|
+
ref = ref.to_all_parts if opts[:all_parts] && !ref.all_parts?
|
|
43
|
+
all_parts = ref.all_parts?
|
|
44
|
+
pubid = all_parts ? ref.identifiers.first : ref
|
|
47
45
|
if year
|
|
48
46
|
# Copy first: a caller's pubid is also its Db cache key.
|
|
49
47
|
pubid = pubid.class.from_hash(pubid.to_hash)
|
|
50
48
|
pubid.date = ::Pubid::Components::Date.new(year: year.to_s)
|
|
51
49
|
end
|
|
52
50
|
|
|
53
|
-
ret = iecbib_get(pubid, opts)
|
|
51
|
+
ret = iecbib_get(pubid, all_parts, opts)
|
|
54
52
|
return nil if ret.nil?
|
|
55
53
|
|
|
56
54
|
ret = ret.to_most_recent_reference unless pubid.date&.year || opts[:keep_year] ||
|
|
@@ -98,17 +96,31 @@ module Relaton
|
|
|
98
96
|
)
|
|
99
97
|
end
|
|
100
98
|
|
|
101
|
-
#
|
|
99
|
+
# The reference as written, else upcased: pubid reads the other
|
|
100
|
+
# components only in upper case, and `(all parts)` only in lower
|
|
101
|
+
# case, so the upcase keeps that suffix as pubid spells it.
|
|
102
|
+
#
|
|
103
|
+
# @param ref [String]
|
|
104
|
+
# @return [Pubid::Iec::Identifier]
|
|
105
|
+
def parse_ref(ref)
|
|
106
|
+
::Pubid::Iec::Identifier.parse ref
|
|
107
|
+
rescue ::Pubid::Errors::Error
|
|
108
|
+
::Pubid::Iec::Identifier.parse ref.upcase.sub("(ALL PARTS)", "(all parts)")
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# @param pubid [Pubid::Iec::Identifier] the document (the inner
|
|
112
|
+
# identifier of an all-parts reference)
|
|
113
|
+
# @param all_parts [Boolean] all parts of the document are asked for
|
|
102
114
|
# @param opts [Hash]
|
|
103
115
|
# @return [Relaton::Iec::ItemData, nil]
|
|
104
|
-
def iecbib_get(pubid, opts) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
|
|
116
|
+
def iecbib_get(pubid, all_parts, opts) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
|
|
105
117
|
Util.info "Fetching from Relaton repository ...", key: pubid.to_s
|
|
106
118
|
# pubid 2.x splits multi-level numbers ("61326-2-6") into part +
|
|
107
119
|
# subpart, so all-parts matching must ignore subpart too.
|
|
108
|
-
exclude =
|
|
120
|
+
exclude = all_parts ? %i[year part subpart] : %i[year]
|
|
109
121
|
result = search(pubid, exclude: exclude) || return
|
|
110
122
|
|
|
111
|
-
if
|
|
123
|
+
if all_parts
|
|
112
124
|
ret = result.to_all_parts(pubid.date&.year&.to_s, opts)
|
|
113
125
|
Util.info "Found: `#{ret&.docidentifier&.first&.content}`", key: pubid.to_s if ret
|
|
114
126
|
return ret
|
data/lib/relaton/iec.rb
CHANGED
|
@@ -3,8 +3,8 @@ require "net/http"
|
|
|
3
3
|
require "moxml"
|
|
4
4
|
require "pubid"
|
|
5
5
|
require "zip"
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
require_relative "index"
|
|
7
|
+
require_relative "iso"
|
|
8
8
|
require_relative "version"
|
|
9
9
|
require_relative "iec/util"
|
|
10
10
|
require_relative "iec/bibliography"
|
data/lib/relaton/ieee.rb
CHANGED
|
@@ -2,8 +2,8 @@ require "digest/md5"
|
|
|
2
2
|
require "faraday"
|
|
3
3
|
require "yaml"
|
|
4
4
|
require "pubid"
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
require_relative "index"
|
|
6
|
+
require_relative "bib"
|
|
7
7
|
require_relative "version"
|
|
8
8
|
require_relative "ieee/util"
|
|
9
9
|
require_relative "ieee/bibliography"
|
data/lib/relaton/ietf.rb
CHANGED
data/lib/relaton/iho.rb
CHANGED
data/lib/relaton/index.rb
CHANGED
data/lib/relaton/isbn.rb
CHANGED
data/lib/relaton/iso.rb
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
require "net/http"
|
|
4
4
|
require "pubid"
|
|
5
|
-
|
|
5
|
+
require_relative "index"
|
|
6
6
|
require "isoics"
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
require_relative "bib"
|
|
8
|
+
require_relative "core"
|
|
9
9
|
require_relative "version"
|
|
10
10
|
require_relative "iso/util"
|
|
11
11
|
require_relative "iso/item_data"
|
data/lib/relaton/itu.rb
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
require "mechanize"
|
|
2
2
|
require "pubid"
|
|
3
3
|
require "digest/md5"
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
require_relative "index"
|
|
5
|
+
require_relative "bib"
|
|
6
|
+
require_relative "core"
|
|
7
7
|
require_relative "version"
|
|
8
8
|
require_relative "itu/util"
|
|
9
9
|
require_relative "itu/item_data"
|
data/lib/relaton/jcgm.rb
CHANGED
data/lib/relaton/jis.rb
CHANGED
data/lib/relaton/nist.rb
CHANGED
data/lib/relaton/oasis.rb
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
# (The IANA/IHO/IALA/OGC/ECMA form; spec/relaton/lazy_loading_spec.rb guards
|
|
6
6
|
# that this file is not itself loaded when a Db is built.)
|
|
7
7
|
require "pubid"
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
require_relative "index"
|
|
9
|
+
require_relative "bib"
|
|
10
10
|
require_relative "version"
|
|
11
11
|
require_relative "oasis/util"
|
|
12
12
|
require_relative "oasis/item_data"
|
data/lib/relaton/ogc.rb
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
# index code names. Processor#remove_index_file names no pubid class: the
|
|
3
3
|
# delete never reads the index (see lib/relaton/index/CLAUDE.md).
|
|
4
4
|
require "pubid"
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
require_relative "index"
|
|
6
|
+
require_relative "iso"
|
|
7
7
|
require_relative "version"
|
|
8
8
|
require_relative "ogc/util"
|
|
9
9
|
require_relative "ogc/item_data"
|
data/lib/relaton/oiml.rb
CHANGED
data/lib/relaton/omg.rb
CHANGED
data/lib/relaton/plateau.rb
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
require "net/http"
|
|
2
2
|
require "uri"
|
|
3
3
|
require "pubid"
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
require_relative "index"
|
|
5
|
+
require_relative "iso"
|
|
6
6
|
require_relative "version"
|
|
7
7
|
require_relative "plateau/util"
|
|
8
8
|
# require_relative "plateau/docidentifier"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# The rendering surface of the consolidated gem — the `relaton/render`
|
|
4
|
+
# entry the standalone relaton-render gem served as its primary require
|
|
5
|
+
# path. `require "relaton-render"` (the hyphen umbrella in
|
|
6
|
+
# lib/relaton-render.rb) resolves to this same surface: one gem ships
|
|
7
|
+
# both codebases, so both spellings must keep working, and neither may
|
|
8
|
+
# fall through to a still-bundled retired gem.
|
|
9
|
+
require_relative "render/iso690"
|
|
10
|
+
|
|
11
|
+
module Relaton
|
|
12
|
+
module Render
|
|
13
|
+
# A bibliographic item whose style template resolves to nothing: the
|
|
14
|
+
# single-item API raises, the batch API skips
|
|
15
|
+
class Unrenderable < StandardError; end
|
|
16
|
+
end
|
|
17
|
+
end
|