relaton-omg 1.20.1 → 2.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 599fa4af8ab8b640f7903f29e9e5e3df4588ed51edbbb2c80ad03ddc83d0d51e
4
- data.tar.gz: 2dcb6b980c8b8a4ed33bc2cb080b035d27395bdddcf1ea7d742bd35e6b9509dd
3
+ metadata.gz: 225388efdbed90395039c1f28bd0694182730f06cd60e5afb8333985d1a7aa11
4
+ data.tar.gz: 62a961cd80770fd534128ddc36f42b3b465ffba58dfb668a15eacf8a0cb0ee71
5
5
  SHA512:
6
- metadata.gz: b83bf97ed7faa7e477de714a3822cd10ac9c539729af4d1774ae3d451cad938b14c803bd881ec2465a8016512fdc2117a380a895f1d21f2f808a2c48388c8ceb
7
- data.tar.gz: 4562c012dcd35c83f8977461230adde75c0e851d5af8536038ecca42b63b96b6e21bb003fd4d15ffce0a7be61d1ac19808dfe500f1088b4602101c1d9bb4e645
6
+ metadata.gz: a7b7956b637f1f53b723cb90d5db542c88c1c01cfc45191e211be05f25db63e9caaf75f3a72239bc51fa25058c59d5659ba8a17514031e6177d08663d3a417a5
7
+ data.tar.gz: 1c6493afcafb8b039b6836abf66802c10c0501239d86bbd8dbf9e58b5beab1dff9b0b0e2737a64cf89174a659c0e2790772f049c72225cbfced092e94891e88d
data/.gitignore CHANGED
@@ -9,6 +9,8 @@
9
9
 
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
+ .rubocop-https---raw-githubusercontent-com-riboseinc-oss-guides-master-ci-rubocop-yml
12
13
  Gemfile.lock
13
14
  .vscode/
14
15
  .rubocop-remote-87c7cdd254a8d09d005ee06efac7acc0.yml
16
+ .claude/
data/.rubocop.yml CHANGED
@@ -7,6 +7,6 @@ require: rubocop-rails
7
7
  inherit_from:
8
8
  - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
9
9
  AllCops:
10
- TargetRubyVersion: 2.7
10
+ TargetRubyVersion: 3.2
11
11
  Rails:
12
12
  Enabled: false
data/CLAUDE.md ADDED
@@ -0,0 +1,51 @@
1
+ # CLAUDE.md
2
+
3
+ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+ ## Project Overview
6
+
7
+ relaton-omg is a Ruby gem that searches and fetches standards from The Object Management Group (OMG) at https://www.omg.org. It is part of the larger Relaton family of bibliographic data gems (v2.0.0-alpha.1).
8
+
9
+ ## Commands
10
+
11
+ - **Run all tests:** `bundle exec rspec`
12
+ - **Run a single test:** `bundle exec rspec spec/relaton/omg/item_spec.rb`
13
+ - **Lint:** `bundle exec rubocop` (follows Ribose OSS style guide)
14
+ - **Lint with autofix:** `bundle exec rubocop -a`
15
+ - **Install deps:** `bundle install`
16
+
17
+ ## Architecture
18
+
19
+ ### Module structure
20
+
21
+ All source lives under `lib/relaton/omg/`. The main entry point is `lib/relaton/omg.rb` which loads everything under the `Relaton::Omg` module namespace.
22
+
23
+ ### Class hierarchy
24
+
25
+ The gem extends `relaton-bib` (~> 2.0.0-alpha.1), the core Relaton bibliographic data library:
26
+
27
+ - `Relaton::Omg::Item` < `Bib::Item` — base item class, uses `Bib::ItemData` model
28
+ - `Relaton::Omg::Bibitem` < `Item` — includes `Bib::BibitemShared`, for `<bibitem>` XML
29
+ - `Relaton::Omg::Bibdata` < `Item` — includes `Bib::BibdataShared`, for `<bibdata>` XML
30
+ - `Relaton::Omg::Processor` < `Core::Processor` — relaton-core integration, delegates to `Bibliography`, `Bibitem`, `Item`
31
+ - `Relaton::Omg::Bibliography` — fetches standards via `Scraper`
32
+ - `Relaton::Omg::Scraper` — scrapes https://www.omg.org/spec for bibliographic data
33
+
34
+ ### Serialization formats
35
+
36
+ Items can be serialized to/from YAML and XML. Tests verify round-trip fidelity for all three classes. XML output is validated against RELAX NG schemas in `grammars/`.
37
+
38
+ ### Test patterns
39
+
40
+ - RSpec with `expect` syntax (monkey patching disabled)
41
+ - `equivalent-xml` for XML comparison
42
+ - `ruby-jing` for RELAX NG schema validation against `grammars/relaton-omg-compile.rng`
43
+ - VCR cassettes in `spec/vcr_cassettes/` for HTTP interaction recording
44
+ - Fixtures in `spec/fixtures/` (YAML and XML reference files)
45
+ - Tests follow a round-trip pattern: load fixture → parse → serialize → compare to fixture
46
+
47
+ ## Style
48
+
49
+ - Ruby >= 3.1.0
50
+ - Rubocop inherits from Ribose OSS guide with `rubocop-rails` required but Rails cops disabled
51
+ - OMG document reference format: `OMG {ACRONYM} {VERSION}` (e.g., `OMG AMI4CCM 1.0`)
data/README.adoc CHANGED
@@ -1,4 +1,4 @@
1
- = RelatonOmg
1
+ = Relaton::Omg
2
2
 
3
3
  image:https://img.shields.io/gem/v/relaton-omg.svg["Gem Version", link="https://rubygems.org/gems/relaton-omg"]
4
4
  image:https://github.com/relaton/relaton-omg/workflows/macos/badge.svg["Build Status (macOS)", link="https://github.com/relaton/relaton-omg/actions?workflow=macos"]
@@ -10,7 +10,7 @@ image:https://img.shields.io/github/commits-since/relaton/relaton-omg/latest.svg
10
10
 
11
11
  RelatonOmg is a Ruby gem that searches and fetches standards from https://www.omg.org[The Object Management Group (OMG)].
12
12
 
13
- The standards scrape form https://www.omg.org/spec
13
+ The standards are scraped from https://www.omg.org/spec
14
14
 
15
15
  == Installation
16
16
 
@@ -36,23 +36,23 @@ Or install it yourself as:
36
36
  Reference format is `OMG + {ACRONYM} + {VERSION}`
37
37
 
38
38
  - `ACRONYM` is an acronym from the list of specs https://www.omg.org/spec/#all
39
- - `VERSION` (optional) if omitted then the lastes version is fetched
39
+ - `VERSION` (optional) if omitted then the latest version is fetched
40
40
 
41
41
  [source,ruby]
42
42
  ----
43
- require 'relaton_omg'
43
+ require 'relaton/omg'
44
44
  => true
45
45
 
46
- item = RelatonOmg::OmgBibliography.get 'OMG AMI4CCM 1.0'
47
- [relaton-omg] (OMG AMI4CCM 1.0) Fetching from www.omg.org ...
48
- [relaton-omg] (OMG AMI4CCM 1.0) Found: `AMI4CCM 1.0`
49
- => #<RelatonOmg::OmgBibliographicItem:0x000000010435a520
46
+ item = Relaton::Omg::Bibliography.get 'OMG AMI4CCM 1.0'
47
+ [relaton-omg] INFO: (OMG AMI4CCM 1.0) Fetching from www.omg.org ...
48
+ [relaton-omg] INFO: (OMG AMI4CCM 1.0) Found: `OMG AMI4CCM 1.0`
49
+ => #<Relaton::Bib::ItemData:0x0000000128bf7650
50
50
  ...
51
51
 
52
52
  # Return nil if the document doesn't exist.
53
- RelatonOmg::OmgBibliography.get 'OMG 1111'
54
- [relaton-omg] (OMG 1111) Fetching from www.omg.org ...
55
- [relaton-omg] (OMG 1111) Not found.
53
+ Relaton::Omg::Bibliography.get 'OMG 1111'
54
+ [relaton-omg] INFO: (OMG 1111) Fetching from www.omg.org ...
55
+ [relaton-omg] INFO: (OMG 1111) Not found.
56
56
  => nil
57
57
  ----
58
58
 
@@ -61,54 +61,55 @@ RelatonOmg::OmgBibliography.get 'OMG 1111'
61
61
  [source,ruby]
62
62
  ----
63
63
  item.to_xml
64
- => "<bibitem id="AMI4CCM1.0" schema-version="v1.2.9">
65
- <fetched>2022-12-05</fetched>
66
- <title type="main" format="text/plain" language="en" script="Latn">Asynchronous Method Invocation for CCM</title>
64
+ => "<bibitem id="OMGAMI4CCM10" schema-version="v1.4.1">
65
+ <fetched>2026-02-27</fetched>
66
+ <title language="en" script="Latn" type="main">Asynchronous Method Invocation for CCM</title>
67
67
  <uri type="src">https://www.omg.org/spec/AMI4CCM/1.0/About-AMI4CCM</uri>
68
68
  <uri type="pdf">https://www.omg.org/spec/AMI4CCM/1.0/PDF</uri>
69
- <docidentifier type="OMG" primary="true">AMI4CCM 1.0</docidentifier>
69
+ <docidentifier type="OMG" primary="true">OMG AMI4CCM 1.0</docidentifier>
70
70
  ...
71
71
  </bibitem>"
72
+
73
+ item.to_xml bibdata: true
74
+ => "<bibdata schema-version="v1.4.1">
75
+ <fetched>2026-02-27</fetched>
76
+ <title language="en" script="Latn" type="main">Asynchronous Method Invocation for CCM</title>
77
+ <uri type="src">https://www.omg.org/spec/AMI4CCM/1.0/About-AMI4CCM</uri>
78
+ <uri type="pdf">https://www.omg.org/spec/AMI4CCM/1.0/PDF</uri>
79
+ <docidentifier type="OMG" primary="true">OMG AMI4CCM 1.0</docidentifier>
80
+ ...
81
+ </bibdata>"
72
82
  ----
73
83
 
74
84
  === Typed links
75
85
 
76
- OMG documents may have `src` and `pdf` link types.
86
+ OMG documents may have `src` and `pdf` link source types.
77
87
 
78
88
  [source,ruby]
79
89
  ----
80
- item.link
81
- => [#<RelatonBib::TypedUri:0x00007fa897a72208 @content=#<Addressable::URI:0x80c URI:https://www.omg.org/spec/AMI4CCM/1.0/About-AMI4CCM/>, @type="src">,
82
- #<RelatonBib::TypedUri:0x00007fa897a71600 @content=#<Addressable::URI:0x820 URI:https://www.omg.org/spec/AMI4CCM/1.0/PDF>, @type="pdf">]
90
+ item.source[0].type
91
+ => "src"
92
+
93
+ item.source[0].content
94
+ => "https://www.omg.org/spec/AMI4CCM/1.0/About-AMI4CCM"
83
95
  ----
84
96
 
85
97
  === Create bibliographic item from XML
86
98
 
87
99
  [source,ruby]
88
100
  ----
89
- item = RelatonOmg::OmgBibliographicItem.from_xml 'spec/fixtures/omg_ami4ccm_1_0.xml'
90
- => #<RelatonOmg::OmgBibliographicItem:0x007fb351582e90
91
- ...
92
- ----
93
-
94
- === Create bibliographic item from Hash
95
- [source,ruby]
96
- ----
97
- hash = YAML.load_file 'spec/fixtures/omg_ami4ccm_1_0.yaml'
98
- => {"schema-version"=>"v1.2.9",
99
- "id"=>"AMI4CCM1.0",
100
- ...
101
-
102
- item = RelatonOmg::OmgBibliographicItem.from_hash hash
103
- => #<RelatonOmg::OmgBibliographicItem:0x007f85b0247ec0
101
+ xml = File.read 'spec/fixtures/omg_ami4ccm_1_0.xml', encoding: 'UTF-8'
102
+ item = Relaton::Omg::Bibitem.from_xml xml
103
+ => #<Relaton::Bib::ItemData:0x00000001248f8c00
104
104
  ...
105
105
  ----
106
106
 
107
107
  === Create bibliographic item from YAML
108
108
  [source,ruby]
109
109
  ----
110
- item = RelatonOmg::OmgBibliographicItem.from_yaml 'spec/fixtures/omg_ami4ccm_1_0.yaml'
111
- => #<RelatonOmg::OmgBibliographicItem:0x007f85a00f45d8
110
+ yaml = File.read 'spec/fixtures/omg_ami4ccm_1_0.yaml', encoding: 'UTF-8'
111
+ item = Relaton::Omg::Item.from_yaml yaml
112
+ => #<Relaton::Bib::ItemData:0x000000012813b180
112
113
  ...
113
114
  ----
114
115
 
@@ -118,8 +119,8 @@ RelatonOmg uses the relaton-logger gem for logging. By default, it logs to STDOU
118
119
 
119
120
  == Contributing
120
121
 
121
- Bug reports and pull requests are welcome on GitHub at https://github.com/relaton/relaton-ietf.
122
+ Bug reports and pull requests are welcome on GitHub at https://github.com/relaton/relaton-omg.
122
123
 
123
124
  == License
124
125
 
125
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
126
+ The gem is available as open source under the terms of the https://opensource.org/licenses/MIT[MIT License].