relaton-cli 2.1.2 → 3.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: e5a1c24d98eac5225482cb8db5843062324aadc975c0bacb70947e3237e46579
4
- data.tar.gz: 80c367a77295fb5406b75766a55f17cd7a2913c6c6ca9b8a1b6e5e509892f763
3
+ metadata.gz: a47c862db04dc7abfb595cf5bb150585dc09c6100047727ab33cf5c581c38dba
4
+ data.tar.gz: 2cb6efe9f2cc054b1825fed5a0c85b4988e74d93ecd7fdcb962af4efa6cd8eb9
5
5
  SHA512:
6
- metadata.gz: f1b474359fb025dc6a07d2d395c4dfa84cea46f3f70c3e0d8cebc08c581187aaddd114e7d810294ae8a901a787eed45591aa2c1d18ad609f4632c46173e2e2d4
7
- data.tar.gz: 8aa93ada519675d4ef36ec800f6f53ed188ffd08c86b6ad9c3c786f5a43346feb347d34e717379b3e73885f34db7d475a8572f56497196257beb92609c279141
6
+ metadata.gz: 5433f5f5b96cd5e19e7fb17ee18012b275b6fe1468f38a61e4d6769b7d7b053dedc0d33925244660d8b8051197790a5f72805f0b84c4bc86ff0813e609841b21
7
+ data.tar.gz: 835cca13a812bf83da85d7251da06030da334bed0aa137ffc5d33b15d3482a12e1090c72585f85dfc6d89af8e1c7973f716106cbe07fb3d3fc3dc408b737ba28
data/CLAUDE.md CHANGED
@@ -86,7 +86,10 @@ Tests use VCR cassettes to replay HTTP interactions with standards registries. W
86
86
 
87
87
  ## Key Dependencies
88
88
 
89
- - `relaton ~> 1.20.0` — Core library providing DB, registry, and all standard-body processors
89
+ - `relaton` — Core library providing DB, registry, and all standard-body
90
+ processors. relaton-cli releases in lockstep with it: both the gemspec pin
91
+ (`= <version>`) and `Relaton::Cli::VERSION` derive from the root
92
+ `lib/relaton/version.rb` (`Relaton::VERSION`), so they never drift apart.
90
93
  - `thor` / `thor-hollaback` — CLI framework
91
94
  - `liquid ~> 5` — HTML template rendering
92
95
  - `nokogiri` (transitive via relaton) — XML parsing
data/Gemfile CHANGED
@@ -3,10 +3,17 @@ source "https://rubygems.org"
3
3
  # Specify your gem's dependencies in gemspec
4
4
  gemspec
5
5
 
6
+ # The single combined `relaton` gem lives at the repo root.
7
+ gem "relaton", path: "../.."
6
8
 
9
+ # https://github.com/rails/rails/issues/55886
10
+ # add openssl as an explicit gem to fix SSL verification issues in GHA.
11
+ # gem "openssl"
7
12
 
8
13
  gem "byebug", "~> 11.0"
14
+ gem "debug"
9
15
  gem "equivalent-xml", "~> 0.6"
16
+ gem "fiddle"
10
17
  gem "pry"
11
18
  gem "rake"
12
19
  gem "rspec", "~> 3.0"
@@ -16,5 +23,3 @@ gem "rspec-html", "~> 0.3.0"
16
23
  gem "simplecov"
17
24
  gem "vcr"
18
25
  gem "webmock"
19
- gem "debug"
20
- gem "fiddle"
data/docs/README.adoc CHANGED
@@ -1,7 +1,7 @@
1
1
  = Relaton CLI: Command-line Interface for Bibliographic References
2
2
 
3
3
  image:https://img.shields.io/gem/v/relaton-cli.svg["Gem Version", link="https://rubygems.org/gems/relaton-cli"]
4
- image:https://github.com/relaton/relaton-cli/workflows/rake/badge.svg["Build Status", link="https://github.com/relaton/relaton-cli/actions?workflow=rake"]
4
+ image:https://github.com/relaton/relaton/actions/workflows/rake.yml/badge.svg["Build Status", link="https://github.com/relaton/relaton/actions/workflows/rake.yml"]
5
5
 
6
6
  Relaton CLI is a command-line tool for fetching, converting, and managing
7
7
  bibliographic references to standards (ISO, IEC, IETF, NIST, IEEE, and many
@@ -26,7 +26,7 @@ $ gem install relaton-cli
26
26
 
27
27
  == Requirements
28
28
 
29
- * Ruby >= 3.2.0
29
+ * Ruby >= 3.3.0
30
30
 
31
31
  == Usage
32
32
 
@@ -181,7 +181,7 @@ root:
181
181
  content: proposal
182
182
  ----
183
183
 
184
- A Relaton YAML file describing an individual bibliographic entry is limited to metadata specific to that entry. The link:https://github.com/relaton/relaton-bib/blob/master/docs/hash.adoc#yaml[Relaton YAML] illustrates the common fields supported by all flavor gems.
184
+ A Relaton YAML file describing an individual bibliographic entry is limited to metadata specific to that entry. The link:https://github.com/relaton/relaton-bib/blob/master/docs/hash.adoc#yaml[Relaton YAML] illustrates the common fields supported by all flavors.
185
185
 
186
186
  === relaton xml2yaml
187
187
 
@@ -232,7 +232,8 @@ Render a Relaton YAML file as an HTML file. The `stylesheet` and `liquid-templat
232
232
  $ relaton version
233
233
  ----
234
234
 
235
- Display version information for the CLI and all installed Relaton libraries.
235
+ Display version information for the CLI and the bundled `relaton` gem (every
236
+ flavor now reports the single `relaton` version).
236
237
 
237
238
  === relaton collection
238
239
 
@@ -402,7 +403,7 @@ $ bundle exec rubocop
402
403
 
403
404
  == Contributing
404
405
 
405
- Open an issue or pull request at https://github.com/relaton/relaton-cli.
406
+ Open an issue or pull request at https://github.com/relaton/relaton.
406
407
 
407
408
  This gem is developed, maintained, and funded by
408
409
  https://www.ribose.com[Ribose Inc.]
@@ -218,7 +218,7 @@ module Relaton
218
218
  dup_opts[key] = parse_date_option(dup_opts[key], key.to_s.tr("_", "-").prepend("--")) if dup_opts[key]
219
219
  end
220
220
  validate_date_range dup_opts[:publication_date_after], dup_opts[:publication_date_before]
221
- if (processor = Relaton::Registry.instance.by_type options[:type]&.upcase)
221
+ if (processor = Relaton::Db::Registry.instance.by_type options[:type]&.upcase)
222
222
  doc = Relaton.db.fetch_std code, year, processor.short, **dup_opts
223
223
  elsif options[:type] then return
224
224
  else doc = Relaton.db.fetch(code, year, **dup_opts)
@@ -247,7 +247,7 @@ module Relaton
247
247
 
248
248
  def registered_types
249
249
  @registered_types ||=
250
- Relaton::Registry.instance.processors.each.map { |_n, pr| pr.prefix }
250
+ Relaton::Db::Registry.instance.processors.each.map { |_n, pr| pr.prefix }
251
251
  end
252
252
  end
253
253
  end
@@ -2,7 +2,7 @@ module Relaton
2
2
  module Cli
3
3
  module DataFetcher
4
4
  def fetch(source, options)
5
- processor = Relaton::Registry.instance.find_processor_by_dataset source
5
+ processor = Relaton::Db::Registry.instance.find_processor_by_dataset source
6
6
  unless processor
7
7
  Util.warn "no processor found for `#{source}`"
8
8
  return
@@ -1,5 +1,11 @@
1
+ # relaton-cli ships in lockstep with the combined `relaton` gem, so its version
2
+ # is that gem's version — the single source of truth in Relaton::VERSION. relaton
3
+ # is a hard runtime dependency, so requiring its lightweight version file always
4
+ # resolves. Don't hardcode a string here; it would silently drift on a bump.
5
+ require "relaton/version"
6
+
1
7
  module Relaton
2
8
  module Cli
3
- VERSION = "2.1.2".freeze
9
+ VERSION = Relaton::VERSION
4
10
  end
5
11
  end
@@ -34,7 +34,7 @@ module Relaton
34
34
  # RelatonIso::IsoBiblioraphicItem]
35
35
  def convert_single_file(content)
36
36
  flavor = content.dig("ext", "flavor") || doctype(content["docidentifier"])
37
- if (processor = Registry.instance.by_type(flavor))
37
+ if (processor = Relaton::Db::Registry.instance.by_type(flavor))
38
38
  begin
39
39
  processor.from_yaml content.to_yaml
40
40
  rescue RuntimeError
data/lib/relaton/cli.rb CHANGED
@@ -42,13 +42,15 @@ module Relaton
42
42
  class << self
43
43
  def version
44
44
  require "relaton/bib"
45
- registry = Relaton::Registry.instance
45
+ registry = Relaton::Db::Registry.instance
46
+ # Every flavor now ships inside the single `relaton` gem, so they all
47
+ # report Relaton::VERSION rather than a separate gem version.
46
48
  puts "CLI => #{Relaton::Cli::VERSION}"
47
- puts "relaton => #{Gem.loaded_specs['relaton'].version}"
48
- puts "relaton-bib => #{Gem.loaded_specs['relaton-bib'].version}"
49
+ puts "relaton => #{Relaton::VERSION}"
50
+ puts "relaton-bib => #{Relaton::VERSION}"
49
51
  registry.processors.each_key do |k|
50
52
  name = k.to_s.sub("_", "-")
51
- puts "#{name} => #{Gem.loaded_specs[name].version}"
53
+ puts "#{name} => #{Relaton::VERSION}"
52
54
  end
53
55
  end
54
56
 
@@ -91,7 +93,7 @@ module Relaton
91
93
  proc = get_proc docid
92
94
  return proc if proc
93
95
 
94
- Relaton::Registry.instance.by_type(docid&.text&.match(/^\w+/)&.to_s)
96
+ Relaton::Db::Registry.instance.by_type(docid&.text&.match(/^\w+/)&.to_s)
95
97
  end
96
98
 
97
99
  private
@@ -104,7 +106,7 @@ module Relaton
104
106
  def get_proc(docid)
105
107
  return unless docid && docid[:type]
106
108
 
107
- Relaton::Registry.instance.by_type(docid[:type])
109
+ Relaton::Db::Registry.instance.by_type(docid[:type])
108
110
  end
109
111
  end
110
112
  end
data/lib/relaton-cli.rb CHANGED
@@ -1,4 +1,4 @@
1
- require "relaton"
1
+ require "relaton/db"
2
2
 
3
3
  module Relaton
4
4
  module Cli
data/relaton-cli.gemspec CHANGED
@@ -1,10 +1,14 @@
1
- lib = File.expand_path("lib", __dir__)
2
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
- require "relaton/cli/version"
1
+ # relaton-cli is released in lockstep with the combined `relaton` gem from this
2
+ # repo. Derive the version (and the relaton dependency pin) from the single
3
+ # source of truth — root lib/relaton/version.rb — so `gem bump` on that one file
4
+ # re-stamps both gems. No separate version to hand-sync.
5
+ root_version_file = File.expand_path("../../lib/relaton/version.rb", __dir__)
6
+ relaton_version = File.read(root_version_file)[/VERSION\s*=\s*["']([^"']+)["']/, 1] or
7
+ raise "could not parse Relaton::VERSION from #{root_version_file}"
4
8
 
5
9
  Gem::Specification.new do |spec|
6
10
  spec.name = "relaton-cli"
7
- spec.version = Relaton::Cli::VERSION
11
+ spec.version = relaton_version
8
12
  spec.authors = ["Ribose Inc."]
9
13
  spec.email = ["open.source@ribose.com"]
10
14
 
@@ -20,14 +24,12 @@ Gem::Specification.new do |spec|
20
24
  spec.bindir = "exe"
21
25
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
26
  spec.require_paths = ["lib"]
23
- spec.required_ruby_version = Gem::Requirement.new(">= 3.2.0")
27
+ spec.required_ruby_version = Gem::Requirement.new(">= 3.3.0")
24
28
 
25
- spec.add_runtime_dependency "liquid", "~> 5"
26
- spec.add_runtime_dependency "relaton", "~> 2.1.0"
27
- spec.add_runtime_dependency "thor"
28
- spec.add_runtime_dependency "thor-hollaback"
29
-
30
- # https://github.com/rails/rails/issues/55886
31
- # add openssl as an explicit gem to fix SSL verification issues in GHA.
32
- spec.add_development_dependency "openssl"
29
+ spec.add_dependency "liquid", "~> 5"
30
+ # relaton bundles every flavor plus Relaton::Bib, so depending on `relaton`
31
+ # alone is sufficient — relaton-bib is no longer published standalone.
32
+ spec.add_dependency "relaton", "= #{relaton_version}"
33
+ spec.add_dependency "thor"
34
+ spec.add_dependency "thor-hollaback"
33
35
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.2
4
+ version: 3.0.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-05-29 00:00:00.000000000 Z
11
+ date: 2026-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: liquid
@@ -28,16 +28,16 @@ dependencies:
28
28
  name: relaton
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 2.1.0
33
+ version: 3.0.0.pre.alpha.1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 2.1.0
40
+ version: 3.0.0.pre.alpha.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: thor
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -66,20 +66,6 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: openssl
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: '0'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: '0'
83
69
  description: Relaton Command-line Interface
84
70
  email:
85
71
  - open.source@ribose.com
@@ -90,12 +76,9 @@ extra_rdoc_files:
90
76
  - docs/README.adoc
91
77
  - LICENSE
92
78
  files:
93
- - ".github/workflows/rake.yml"
94
- - ".github/workflows/release.yml"
95
79
  - ".gitignore"
96
80
  - ".hound.yml"
97
81
  - ".rspec"
98
- - ".rubocop.yml"
99
82
  - CHANGELOG.md
100
83
  - CLAUDE.md
101
84
  - Gemfile
@@ -140,7 +123,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
140
123
  requirements:
141
124
  - - ">="
142
125
  - !ruby/object:Gem::Version
143
- version: 3.2.0
126
+ version: 3.3.0
144
127
  required_rubygems_version: !ruby/object:Gem::Requirement
145
128
  requirements:
146
129
  - - ">="
@@ -1,14 +0,0 @@
1
- # Auto-generated by Cimas: Do not edit it manually!
2
- # See https://github.com/metanorma/cimas
3
- name: rake
4
-
5
- on:
6
- push:
7
- branches: [ master, main, lutaml-integration ]
8
- tags: [ v* ]
9
- pull_request:
10
- workflow_dispatch:
11
-
12
- jobs:
13
- rake:
14
- uses: relaton/support/.github/workflows/rake.yml@main
@@ -1,24 +0,0 @@
1
- # Auto-generated by Cimas: Do not edit it manually!
2
- # See https://github.com/metanorma/cimas
3
- name: release
4
-
5
- on:
6
- workflow_dispatch:
7
- inputs:
8
- next_version:
9
- description: |
10
- Next release version. Possible values: x.y.z, major, minor, patch (or pre|rc|etc).
11
- Also, you can pass 'skip' to skip 'git tag' and do 'gem push' for the current version
12
- required: true
13
- default: 'skip'
14
- repository_dispatch:
15
- types: [ do-release ]
16
-
17
-
18
- jobs:
19
- release:
20
- uses: relaton/support/.github/workflows/release.yml@main
21
- with:
22
- next_version: ${{ github.event.inputs.next_version }}
23
- secrets:
24
- rubygems-api-key: ${{ secrets.RELATON_CI_RUBYGEMS_API_KEY }}
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: true