relaton-ietf 2.0.0 → 2.1.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6d28ac0d8df8ab932cb60dfe07710ae8e1fdb7907fa532b33d6761d9add3d4c3
4
- data.tar.gz: bbafccc58b4d149c343b77beebfe13670ec7aebbeb5aa3433cef029a33e97838
3
+ metadata.gz: 40f1573f12d0f2dfedd0210b9f3236173a71ffbb9dc9131ca9104364e1756ed2
4
+ data.tar.gz: 6315493dca67a75115d572a4b1f4768f7d888aa85955ba2c3ef88838084c50c3
5
5
  SHA512:
6
- metadata.gz: 529415643a3b03eb4460c30b787bbffacf6012882c01d38ea5ad1104aa39c6f8985275ba84cfd4f6a098b636b34dbde830a780c88d05c4c2fb8e443f62439c66
7
- data.tar.gz: 557158e95a38be647662be5e8c8eadb87092b066fae81164e30bd2505e35b48ea255062fbed54b436434bb462415d71f5ebf3cf56137e896d459e41469da33b8
6
+ metadata.gz: 8b26751fe163cc4f6a51111bee04408286532be84cac8bc48cb9ab1c0c6a19a9df83dae36fa705af66bed590c3455cc58b75f4e8a80e760bd2136487243796e1
7
+ data.tar.gz: a4b13883749c08236f5f2b7fbcaa478895a83b5dab121fc04a33f66c7014e05cc003c188a96ba7c23527aeabf03113a72e14885a2900c6d4d609086ab7bdadd1
data/CLAUDE.md CHANGED
@@ -60,6 +60,7 @@ Bib::Converter::BibXml::FromRfcxml # base: handles <reference> generically
60
60
 
61
61
  ## Testing Patterns
62
62
 
63
+ - **Index fixture:** `spec/fixtures/index-v1.zip` is pre-loaded into `Relaton::Index` pool in `before(:suite)` (configured in `spec/support/webmock.rb`). Run `rake spec:update_index` to refresh from relaton-data-rfcs/rfcsubseries/ids.
63
64
  - **VCR cassettes** in `spec/vcr_cassettes/` record HTTP interactions; tests use `vcr: "cassette_name"` metadata
64
65
  - **WebMock** disables net connections by default
65
66
  - **Fixtures** in `spec/fixtures/` — XML/YAML expected outputs; many tests auto-generate fixtures on first run (`File.write file, xml unless File.exist? file`)
data/Gemfile CHANGED
@@ -8,6 +8,7 @@ gemspec
8
8
  gem "rake", "~> 13.0"
9
9
  gem "rspec", "~> 3.0"
10
10
 
11
+
11
12
  gem "equivalent-xml"
12
13
  gem "pry-byebug"
13
14
  gem "ruby-jing"
data/README.adoc CHANGED
@@ -154,6 +154,10 @@ Done in: 1360 sec.
154
154
 
155
155
  Relaton::Ietf uses the relaton-logger gem for logging. By default, it logs to STDOUT. To change the log levels and add other loggers, read the https://github.com/relaton/relaton-logger#usage[relaton-logger] documentation.
156
156
 
157
+ == Development
158
+
159
+ To update the index test fixtures (used by tests), run `rake spec:update_index`. This downloads the latest index files from the https://github.com/relaton/relaton-data-rfcs[relaton-data-rfcs], https://github.com/relaton/relaton-data-rfcsubseries[relaton-data-rfcsubseries], and https://github.com/relaton/relaton-data-ids[relaton-data-ids] repositories.
160
+
157
161
  == Contributing
158
162
 
159
163
  Bug reports and pull requests are welcome on GitHub at https://github.com/metanorma/relaton-ietf.
data/Rakefile CHANGED
@@ -4,3 +4,32 @@ require "rspec/core/rake_task"
4
4
  RSpec::Core::RakeTask.new(:spec)
5
5
 
6
6
  task :default => :spec
7
+
8
+ namespace :spec do
9
+ desc "Download latest IETF index fixtures from relaton-data repos"
10
+ task :update_index do
11
+ require "net/http"
12
+ require "uri"
13
+
14
+ indexes = {
15
+ "rfc-index-v1.zip" => "https://raw.githubusercontent.com/relaton/relaton-data-rfcs/data-v2/index-v1.zip",
16
+ "rss-index-v1.zip" => "https://raw.githubusercontent.com/relaton/relaton-data-rfcsubseries/data-v2/index-v1.zip",
17
+ "ids-index-v1.zip" => "https://raw.githubusercontent.com/relaton/relaton-data-ids/data-v2/index-v1.zip",
18
+ }
19
+
20
+ indexes.each do |filename, url|
21
+ dest = File.join(__dir__, "spec", "fixtures", filename)
22
+
23
+ puts "Downloading #{url} ..."
24
+ uri = URI.parse(url)
25
+ response = Net::HTTP.get_response(uri)
26
+
27
+ if response.is_a?(Net::HTTPSuccess)
28
+ File.binwrite(dest, response.body)
29
+ puts "Updated #{dest} (#{response.body.bytesize} bytes)"
30
+ else
31
+ abort "Failed to download #{filename}: HTTP #{response.code}"
32
+ end
33
+ end
34
+ end
35
+ end
data/grammars/biblio.rng CHANGED
@@ -2015,15 +2015,11 @@ provided that it is not the entire bibliographic item that is so related</a:docu
2015
2015
  <a:documentation>A version of the bibliographic item (within an edition). Can be used for drafts</a:documentation>
2016
2016
  <element name="version">
2017
2017
  <optional>
2018
- <ref name="revision-date">
2019
- <a:documentation>The date at which the current version of the bibliographic item was produced</a:documentation>
2020
- </ref>
2021
- </optional>
2022
- <optional>
2023
- <ref name="draft">
2024
- <a:documentation>The identifier for the current draft of the bibliographic item</a:documentation>
2025
- </ref>
2018
+ <attribute name="type">
2019
+ <a:documentation>Versioning scheme, in case of multiple versioning schemes</a:documentation>
2020
+ </attribute>
2026
2021
  </optional>
2022
+ <text/>
2027
2023
  </element>
2028
2024
  </define>
2029
2025
  <define name="vedition">
@@ -1,6 +1,7 @@
1
1
  module Relaton
2
2
  module Ietf
3
3
  class Bibdata < Item
4
+ model ItemData
4
5
  include Bib::BibdataShared
5
6
  end
6
7
  end
@@ -1,6 +1,7 @@
1
1
  module Relaton
2
2
  module Ietf
3
3
  class Bibitem < Item
4
+ model ItemData
4
5
  include Bib::BibitemShared
5
6
  end
6
7
  end
@@ -1,15 +1,6 @@
1
1
  module Relaton
2
2
  module Ietf
3
3
  module BibXMLParser # rubocop:disable Metrics/ModuleLength
4
- # Workaround for rfcxml v0.2.1 circular dependency:
5
- # Sup inherits Sub before Sub finishes declaring attributes,
6
- # leaving Sup.attributes empty. Copy them over.
7
- if defined?(Rfcxml::V3::Sup) && Rfcxml::V3::Sup.attributes.empty?
8
- Rfcxml::V3::Sub.attributes.each do |name, attr|
9
- Rfcxml::V3::Sup.attributes[name] = attr
10
- end
11
- end
12
-
13
4
  extend self
14
5
 
15
6
  def parse(xml)
@@ -3,13 +3,8 @@ require_relative "processing_instructions"
3
3
 
4
4
  module Relaton
5
5
  module Ietf
6
- class Ext < Lutaml::Model::Serializable
7
- attribute :schema_version, method: :get_schema_version
6
+ class Ext < Bib::Ext
8
7
  attribute :doctype, Doctype
9
- attribute :subdoctype, :string
10
- attribute :flavor, :string
11
- attribute :ics, Bib::ICS, collection: true
12
- attribute :structuredidentifier, Bib::StructuredIdentifier, collection: true
13
8
  attribute :area, :string, collection: true, values: %W[
14
9
  apt gen int ops rtg sec tsv Applications\sand\sReal-Time General
15
10
  Internet Operations\sand\sManagement Routing Security Transport
@@ -27,12 +22,6 @@ module Relaton
27
22
  attribute :show_on_front_page, :string
28
23
 
29
24
  xml do
30
- map_attribute "schema-version", to: :schema_version
31
- map_element "doctype", to: :doctype
32
- map_element "subdoctype", to: :subdoctype
33
- map_element "flavor", to: :flavor
34
- map_element "ics", to: :ics
35
- map_element "structuredidentifier", to: :structuredidentifier
36
25
  map_element "area", to: :area
37
26
  map_element "stream", to: :stream
38
27
  map_element "ipr", to: :ipr
@@ -47,9 +36,28 @@ module Relaton
47
36
  map_element "showOnFrontPage", to: :show_on_front_page
48
37
  end
49
38
 
50
- def get_schema_version
51
- Relaton.schema_versions["relaton-model-ietf"]
39
+ key_value do
40
+ map_element "schema_version", to: :schema_version, render_default: true
41
+ map_element "doctype", to: :doctype
42
+ map_element "subdoctype", to: :subdoctype
43
+ map_element "flavor", to: :flavor
44
+ map_element "ics", to: :ics
45
+ map_element "structuredidentifier", to: :structuredidentifier
46
+ map_element "area", to: :area
47
+ map_element "stream", to: :stream
48
+ map_element "ipr", to: :ipr
49
+ map_element "pi", to: :pi
50
+ map_element "consensus", to: :consensus
51
+ map_element "index_include", to: :index_include
52
+ map_element "ipr_extract", to: :ipr_extract
53
+ map_element "sort_refs", to: :sort_refs
54
+ map_element "sym_refs", to: :sym_refs
55
+ map_element "toc_include", to: :toc_include
56
+ map_element "toc_depth", to: :toc_depth
57
+ map_element "show_on_front_page", to: :show_on_front_page
52
58
  end
59
+
60
+ def get_schema_version = Relaton.schema_versions["relaton-model-ietf"]
53
61
  end
54
62
  end
55
63
  end
@@ -9,3 +9,8 @@ module Relaton
9
9
  end
10
10
  end
11
11
  end
12
+
13
+ require_relative "relation"
14
+
15
+ Relaton::Ietf::Item.attribute :relation, Relaton::Ietf::Relation,
16
+ collection: true, initialize_empty: true
@@ -1,9 +1,18 @@
1
- require_relative "ext"
2
-
3
1
  module Relaton
4
2
  module Ietf
5
- class ItemBase < Item
6
- include Bib::ItemBaseAttributes
3
+ class ItemBase < Lutaml::Model::Serializable
4
+ include Bib::NamespaceHelper
5
+
6
+ attr_accessor :type
7
+
8
+ model ItemData
9
+
10
+ instance_exec(&Bib::ItemShared::ATTRIBUTES)
11
+
12
+ xml do
13
+ map_attribute "type", to: :type
14
+ instance_exec(&Bib::ItemShared::XML_BODY)
15
+ end
7
16
  end
8
17
  end
9
18
  end
@@ -0,0 +1,9 @@
1
+ require_relative "item_base"
2
+
3
+ module Relaton
4
+ module Ietf
5
+ class Relation < Bib::Relation
6
+ attribute :bibitem, ItemBase
7
+ end
8
+ end
9
+ end
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative "rfc_index_namespace"
4
+
3
5
  module Relaton
4
6
  module Ietf
5
7
  module Rfc
@@ -8,7 +10,7 @@ module Relaton
8
10
 
9
11
  xml do
10
12
  root "abstract"
11
- namespace "https://www.rfc-editor.org/rfc-index"
13
+ namespace RfcIndexNamespace
12
14
  map_element "p", to: :p
13
15
  end
14
16
  end
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative "rfc_index_namespace"
4
+
3
5
  module Relaton
4
6
  module Ietf
5
7
  module Rfc
@@ -9,7 +11,7 @@ module Relaton
9
11
 
10
12
  xml do
11
13
  root "author"
12
- namespace "https://www.rfc-editor.org/rfc-index"
14
+ namespace RfcIndexNamespace
13
15
  map_element "name", to: :name
14
16
  map_element "title", to: :role_title
15
17
  end
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative "rfc_index_namespace"
3
4
  require_relative "is_also"
4
5
  require_relative "author"
5
6
  require_relative "entry_date"
@@ -13,8 +14,6 @@ module Relaton
13
14
  module Rfc
14
15
  # Model for index entries (bcp-entry, fyi-entry, std-entry, rfc-entry)
15
16
  class Entry < Lutaml::Model::Serializable # rubocop:disable Metrics/ClassLength
16
- NAMESPACE = "https://www.rfc-editor.org/rfc-index"
17
-
18
17
  TITLE_PREFIXES = {
19
18
  "bcp" => "Best Current Practice",
20
19
  "fyi" => "For Your Information",
@@ -47,7 +46,7 @@ module Relaton
47
46
 
48
47
  xml do
49
48
  root "bcp-entry"
50
- namespace NAMESPACE
49
+ namespace RfcIndexNamespace
51
50
 
52
51
  map_element "doc-id", to: :doc_id
53
52
  map_element "title", to: :title
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative "rfc_index_namespace"
4
+
3
5
  module Relaton
4
6
  module Ietf
5
7
  module Rfc
@@ -9,7 +11,7 @@ module Relaton
9
11
 
10
12
  xml do
11
13
  root "date"
12
- namespace "https://www.rfc-editor.org/rfc-index"
14
+ namespace RfcIndexNamespace
13
15
  map_element "month", to: :month
14
16
  map_element "year", to: :year
15
17
  end
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative "rfc_index_namespace"
4
+
3
5
  module Relaton
4
6
  module Ietf
5
7
  module Rfc
@@ -8,7 +10,7 @@ module Relaton
8
10
 
9
11
  xml do
10
12
  root "format"
11
- namespace "https://www.rfc-editor.org/rfc-index"
13
+ namespace RfcIndexNamespace
12
14
  map_element "file-format", to: :file_format
13
15
  end
14
16
  end
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative "rfc_index_namespace"
3
4
  require_relative "entry"
4
5
 
5
6
  module Relaton
@@ -7,8 +8,6 @@ module Relaton
7
8
  module Rfc
8
9
  # Model for the root <rfc-index> element
9
10
  class Index < Lutaml::Model::Serializable
10
- NAMESPACE = "https://www.rfc-editor.org/rfc-index"
11
-
12
11
  attribute :bcp_entries, Entry, collection: true
13
12
  attribute :fyi_entries, Entry, collection: true
14
13
  attribute :std_entries, Entry, collection: true
@@ -16,7 +15,7 @@ module Relaton
16
15
 
17
16
  xml do
18
17
  root "rfc-index"
19
- namespace NAMESPACE
18
+ namespace RfcIndexNamespace
20
19
 
21
20
  map_element "bcp-entry", to: :bcp_entries
22
21
  map_element "fyi-entry", to: :fyi_entries
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative "rfc_index_namespace"
4
+
3
5
  module Relaton
4
6
  module Ietf
5
7
  module Rfc
@@ -9,7 +11,7 @@ module Relaton
9
11
 
10
12
  xml do
11
13
  root "is-also"
12
- namespace "https://www.rfc-editor.org/rfc-index"
14
+ namespace RfcIndexNamespace
13
15
 
14
16
  map_element "doc-id", to: :doc_id
15
17
  end
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative "rfc_index_namespace"
4
+
3
5
  module Relaton
4
6
  module Ietf
5
7
  module Rfc
@@ -8,7 +10,7 @@ module Relaton
8
10
 
9
11
  xml do
10
12
  root "keywords"
11
- namespace "https://www.rfc-editor.org/rfc-index"
13
+ namespace RfcIndexNamespace
12
14
  map_element "kw", to: :kw
13
15
  end
14
16
  end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Relaton
4
+ module Ietf
5
+ module Rfc
6
+ class RfcIndexNamespace < Lutaml::Xml::W3c::XmlNamespace
7
+ uri "https://www.rfc-editor.org/rfc-index"
8
+ end
9
+ end
10
+ end
11
+ end
@@ -1,5 +1,5 @@
1
1
  module Relaton
2
2
  module Ietf
3
- VERSION = "2.0.0".freeze
3
+ VERSION = "2.1.0".freeze
4
4
  end
5
5
  end
data/lib/relaton/ietf.rb CHANGED
@@ -7,7 +7,6 @@ require_relative "ietf/version"
7
7
  require_relative "ietf/util"
8
8
  require_relative "ietf/item_data"
9
9
  require_relative "ietf/item"
10
- require_relative "ietf/item_base"
11
10
  require_relative "ietf/bibitem"
12
11
  require_relative "ietf/bibdata"
13
12
  require_relative "ietf/rfc/index"
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
30
30
  spec.required_ruby_version = Gem::Requirement.new(">= 3.2.0")
31
31
 
32
32
  spec.add_dependency "base64"
33
- spec.add_dependency "relaton-bib", "~> 2.0.0"
33
+ spec.add_dependency "relaton-bib", "~> 2.1.0"
34
34
  spec.add_dependency "relaton-core", "~> 0.0.13"
35
35
  spec.add_dependency "relaton-index", "~> 0.2.3"
36
36
  end
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-ietf
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
+ autorequire:
8
9
  bindir: exe
9
10
  cert_chain: []
10
- date: 1980-01-02 00:00:00.000000000 Z
11
+ date: 2026-05-04 00:00:00.000000000 Z
11
12
  dependencies:
12
13
  - !ruby/object:Gem::Dependency
13
14
  name: base64
@@ -29,14 +30,14 @@ dependencies:
29
30
  requirements:
30
31
  - - "~>"
31
32
  - !ruby/object:Gem::Version
32
- version: 2.0.0
33
+ version: 2.1.0
33
34
  type: :runtime
34
35
  prerelease: false
35
36
  version_requirements: !ruby/object:Gem::Requirement
36
37
  requirements:
37
38
  - - "~>"
38
39
  - !ruby/object:Gem::Version
39
- version: 2.0.0
40
+ version: 2.1.0
40
41
  - !ruby/object:Gem::Dependency
41
42
  name: relaton-core
42
43
  requirement: !ruby/object:Gem::Requirement
@@ -108,6 +109,7 @@ files:
108
109
  - lib/relaton/ietf/item_data.rb
109
110
  - lib/relaton/ietf/processing_instructions.rb
110
111
  - lib/relaton/ietf/processor.rb
112
+ - lib/relaton/ietf/relation.rb
111
113
  - lib/relaton/ietf/rfc/abstract.rb
112
114
  - lib/relaton/ietf/rfc/author.rb
113
115
  - lib/relaton/ietf/rfc/entry.rb
@@ -116,15 +118,17 @@ files:
116
118
  - lib/relaton/ietf/rfc/index.rb
117
119
  - lib/relaton/ietf/rfc/is_also.rb
118
120
  - lib/relaton/ietf/rfc/keywords.rb
121
+ - lib/relaton/ietf/rfc/rfc_index_namespace.rb
119
122
  - lib/relaton/ietf/scraper.rb
120
123
  - lib/relaton/ietf/util.rb
121
124
  - lib/relaton/ietf/version.rb
122
125
  - lib/relaton/ietf/wg_name_resolver.rb
123
- - relaton_ietf.gemspec
126
+ - relaton-ietf.gemspec
124
127
  homepage: https://github.com/metanorma/relaton-ietf
125
128
  licenses:
126
129
  - BSD-2-Clause
127
130
  metadata: {}
131
+ post_install_message:
128
132
  rdoc_options: []
129
133
  require_paths:
130
134
  - lib
@@ -139,7 +143,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
143
  - !ruby/object:Gem::Version
140
144
  version: '0'
141
145
  requirements: []
142
- rubygems_version: 3.6.9
146
+ rubygems_version: 3.5.22
147
+ signing_key:
143
148
  specification_version: 4
144
149
  summary: 'Relaton::Ietf: retrieve IETF Standards for bibliographic use using the BibliographicItem
145
150
  model'