relaton-cli 2.1.3 → 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/Gemfile +13 -7
- data/lib/relaton/cli/command.rb +2 -5
- data/lib/relaton/cli/data_fetcher.rb +1 -1
- data/lib/relaton/cli/version.rb +1 -1
- data/lib/relaton/cli/yaml_convertor.rb +1 -1
- data/lib/relaton/cli.rb +5 -14
- data/lib/relaton-cli.rb +1 -1
- data/relaton-cli.gemspec +7 -10
- metadata +22 -20
- data/.rubocop.yml +0 -12
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ec3c9fd306d4fce0c6fa28a8f77a80d18eeabb2eb44fa3f2b93329f7a46011ee
|
|
4
|
+
data.tar.gz: 5353712fb017ddca3b5f25ef27ec7ea78b88668ac29e09ffab0605c8784ada4a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f71fef5cb4c191092621c2e9e75030be676f8f7f1f52342e233e977ccc59b36ecc8ec4e246908385081d35738a5227c82dbf25d83cfff3b65aeb8a5d213f9a5f
|
|
7
|
+
data.tar.gz: 6875477222a8b3111f9cf5d2cf4b3d67c8387b2eaceeca19915dfb110bc57220542ef0b93d6abf1aa7ce83f1aa0a1a4cc33e8a32a1a3ec361edc31f760a48d5d
|
data/Gemfile
CHANGED
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
source "https://rubygems.org"
|
|
2
2
|
|
|
3
|
-
git_source(:github) { |repo| "https://github.com/#{repo}" }
|
|
4
|
-
|
|
5
3
|
# Specify your gem's dependencies in gemspec
|
|
6
4
|
gemspec
|
|
7
5
|
|
|
8
|
-
#
|
|
9
|
-
|
|
10
|
-
|
|
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
|
+
|
|
14
|
+
# https://github.com/rails/rails/issues/55886
|
|
15
|
+
# add openssl as an explicit gem to fix SSL verification issues in GHA.
|
|
16
|
+
# gem "openssl"
|
|
11
17
|
|
|
12
18
|
gem "byebug", "~> 11.0"
|
|
19
|
+
gem "debug"
|
|
13
20
|
gem "equivalent-xml", "~> 0.6"
|
|
21
|
+
gem "fiddle"
|
|
14
22
|
gem "pry"
|
|
15
23
|
gem "rake"
|
|
16
24
|
gem "rspec", "~> 3.0"
|
|
@@ -20,5 +28,3 @@ gem "rspec-html", "~> 0.3.0"
|
|
|
20
28
|
gem "simplecov"
|
|
21
29
|
gem "vcr"
|
|
22
30
|
gem "webmock"
|
|
23
|
-
gem "debug"
|
|
24
|
-
gem "fiddle"
|
data/lib/relaton/cli/command.rb
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
require "date"
|
|
2
|
-
require "parslet"
|
|
3
2
|
require "relaton/cli/relaton_file"
|
|
4
3
|
require "relaton/cli/xml_convertor"
|
|
5
4
|
require "relaton/cli/yaml_convertor"
|
|
@@ -219,7 +218,7 @@ module Relaton
|
|
|
219
218
|
dup_opts[key] = parse_date_option(dup_opts[key], key.to_s.tr("_", "-").prepend("--")) if dup_opts[key]
|
|
220
219
|
end
|
|
221
220
|
validate_date_range dup_opts[:publication_date_after], dup_opts[:publication_date_before]
|
|
222
|
-
if (processor = Relaton::
|
|
221
|
+
if (processor = Relaton::Db::Registry.instance.by_type options[:type]&.upcase)
|
|
223
222
|
doc = Relaton.db.fetch_std code, year, processor.short, **dup_opts
|
|
224
223
|
elsif options[:type] then return
|
|
225
224
|
else doc = Relaton.db.fetch(code, year, **dup_opts)
|
|
@@ -227,8 +226,6 @@ module Relaton
|
|
|
227
226
|
return "No matching bibliographic entry found" unless doc
|
|
228
227
|
|
|
229
228
|
serialize doc, options[:format]
|
|
230
|
-
rescue Parslet::ParseFailed
|
|
231
|
-
%("#{code}" is not a recognized standards identifier)
|
|
232
229
|
rescue Relaton::RequestError => e
|
|
233
230
|
e.message
|
|
234
231
|
end
|
|
@@ -250,7 +247,7 @@ module Relaton
|
|
|
250
247
|
|
|
251
248
|
def registered_types
|
|
252
249
|
@registered_types ||=
|
|
253
|
-
Relaton::
|
|
250
|
+
Relaton::Db::Registry.instance.processors.each.map { |_n, pr| pr.prefix }
|
|
254
251
|
end
|
|
255
252
|
end
|
|
256
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::
|
|
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
|
data/lib/relaton/cli/version.rb
CHANGED
|
@@ -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 = Relaton::
|
|
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
|
@@ -40,24 +40,15 @@ module Relaton
|
|
|
40
40
|
end
|
|
41
41
|
|
|
42
42
|
class << self
|
|
43
|
-
# The processor registry moved in relaton v3: the top-level
|
|
44
|
-
# Relaton::Registry became Relaton::Db::Registry. The v2 line keeps
|
|
45
|
-
# the old constant, so resolve whichever is present.
|
|
46
|
-
def registry
|
|
47
|
-
Relaton::Db::Registry.instance
|
|
48
|
-
rescue NameError
|
|
49
|
-
Relaton::Registry.instance
|
|
50
|
-
end
|
|
51
|
-
|
|
52
43
|
def version
|
|
53
44
|
require "relaton/bib"
|
|
54
|
-
registry =
|
|
45
|
+
registry = Relaton::Db::Registry.instance
|
|
55
46
|
puts "CLI => #{Relaton::Cli::VERSION}"
|
|
56
47
|
puts "relaton => #{Gem.loaded_specs['relaton'].version}"
|
|
48
|
+
puts "relaton-bib => #{Gem.loaded_specs['relaton-bib'].version}"
|
|
57
49
|
registry.processors.each_key do |k|
|
|
58
50
|
name = k.to_s.sub("_", "-")
|
|
59
|
-
|
|
60
|
-
puts "#{name} => #{spec.version}" if spec
|
|
51
|
+
puts "#{name} => #{Gem.loaded_specs[name].version}"
|
|
61
52
|
end
|
|
62
53
|
end
|
|
63
54
|
|
|
@@ -100,7 +91,7 @@ module Relaton
|
|
|
100
91
|
proc = get_proc docid
|
|
101
92
|
return proc if proc
|
|
102
93
|
|
|
103
|
-
|
|
94
|
+
Relaton::Db::Registry.instance.by_type(docid&.text&.match(/^\w+/)&.to_s)
|
|
104
95
|
end
|
|
105
96
|
|
|
106
97
|
private
|
|
@@ -113,7 +104,7 @@ module Relaton
|
|
|
113
104
|
def get_proc(docid)
|
|
114
105
|
return unless docid && docid[:type]
|
|
115
106
|
|
|
116
|
-
|
|
107
|
+
Relaton::Db::Registry.instance.by_type(docid[:type])
|
|
117
108
|
end
|
|
118
109
|
end
|
|
119
110
|
end
|
data/lib/relaton-cli.rb
CHANGED
data/relaton-cli.gemspec
CHANGED
|
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
|
10
10
|
|
|
11
11
|
spec.summary = "Relaton Command-line Interface"
|
|
12
12
|
spec.description = "Relaton Command-line Interface"
|
|
13
|
-
spec.homepage = "https://github.com/
|
|
13
|
+
spec.homepage = "https://github.com/metanorma/relaton-cli"
|
|
14
14
|
spec.license = "BSD-2-Clause"
|
|
15
15
|
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
|
@@ -20,14 +20,11 @@ Gem::Specification.new do |spec|
|
|
|
20
20
|
spec.bindir = "exe"
|
|
21
21
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
22
22
|
spec.require_paths = ["lib"]
|
|
23
|
-
spec.required_ruby_version = Gem::Requirement.new(">= 3.
|
|
23
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 3.3.0")
|
|
24
24
|
|
|
25
|
-
spec.
|
|
26
|
-
spec.
|
|
27
|
-
spec.
|
|
28
|
-
spec.
|
|
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"
|
|
25
|
+
spec.add_dependency "liquid", "~> 5"
|
|
26
|
+
spec.add_dependency "relaton-bib", "~> 2.2.0.pre.alpha.1"
|
|
27
|
+
spec.add_dependency "relaton", "~> 2.2.0.pre.alpha.1"
|
|
28
|
+
spec.add_dependency "thor"
|
|
29
|
+
spec.add_dependency "thor-hollaback"
|
|
33
30
|
end
|
metadata
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: relaton-cli
|
|
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
|
+
autorequire:
|
|
8
9
|
bindir: exe
|
|
9
10
|
cert_chain: []
|
|
10
|
-
date:
|
|
11
|
+
date: 2026-06-26 00:00:00.000000000 Z
|
|
11
12
|
dependencies:
|
|
12
13
|
- !ruby/object:Gem::Dependency
|
|
13
14
|
name: liquid
|
|
@@ -24,35 +25,35 @@ dependencies:
|
|
|
24
25
|
- !ruby/object:Gem::Version
|
|
25
26
|
version: '5'
|
|
26
27
|
- !ruby/object:Gem::Dependency
|
|
27
|
-
name: relaton
|
|
28
|
+
name: relaton-bib
|
|
28
29
|
requirement: !ruby/object:Gem::Requirement
|
|
29
30
|
requirements:
|
|
30
|
-
- - "
|
|
31
|
+
- - "~>"
|
|
31
32
|
- !ruby/object:Gem::Version
|
|
32
|
-
version:
|
|
33
|
+
version: 2.2.0.pre.alpha.1
|
|
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:
|
|
40
|
+
version: 2.2.0.pre.alpha.1
|
|
40
41
|
- !ruby/object:Gem::Dependency
|
|
41
|
-
name:
|
|
42
|
+
name: relaton
|
|
42
43
|
requirement: !ruby/object:Gem::Requirement
|
|
43
44
|
requirements:
|
|
44
|
-
- - "
|
|
45
|
+
- - "~>"
|
|
45
46
|
- !ruby/object:Gem::Version
|
|
46
|
-
version:
|
|
47
|
+
version: 2.2.0.pre.alpha.1
|
|
47
48
|
type: :runtime
|
|
48
49
|
prerelease: false
|
|
49
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
50
51
|
requirements:
|
|
51
|
-
- - "
|
|
52
|
+
- - "~>"
|
|
52
53
|
- !ruby/object:Gem::Version
|
|
53
|
-
version:
|
|
54
|
+
version: 2.2.0.pre.alpha.1
|
|
54
55
|
- !ruby/object:Gem::Dependency
|
|
55
|
-
name: thor
|
|
56
|
+
name: thor
|
|
56
57
|
requirement: !ruby/object:Gem::Requirement
|
|
57
58
|
requirements:
|
|
58
59
|
- - ">="
|
|
@@ -66,13 +67,13 @@ dependencies:
|
|
|
66
67
|
- !ruby/object:Gem::Version
|
|
67
68
|
version: '0'
|
|
68
69
|
- !ruby/object:Gem::Dependency
|
|
69
|
-
name:
|
|
70
|
+
name: thor-hollaback
|
|
70
71
|
requirement: !ruby/object:Gem::Requirement
|
|
71
72
|
requirements:
|
|
72
73
|
- - ">="
|
|
73
74
|
- !ruby/object:Gem::Version
|
|
74
75
|
version: '0'
|
|
75
|
-
type: :
|
|
76
|
+
type: :runtime
|
|
76
77
|
prerelease: false
|
|
77
78
|
version_requirements: !ruby/object:Gem::Requirement
|
|
78
79
|
requirements:
|
|
@@ -86,15 +87,14 @@ executables:
|
|
|
86
87
|
- relaton
|
|
87
88
|
extensions: []
|
|
88
89
|
extra_rdoc_files:
|
|
89
|
-
- LICENSE
|
|
90
90
|
- docs/README.adoc
|
|
91
|
+
- LICENSE
|
|
91
92
|
files:
|
|
92
93
|
- ".github/workflows/rake.yml"
|
|
93
94
|
- ".github/workflows/release.yml"
|
|
94
95
|
- ".gitignore"
|
|
95
96
|
- ".hound.yml"
|
|
96
97
|
- ".rspec"
|
|
97
|
-
- ".rubocop.yml"
|
|
98
98
|
- CHANGELOG.md
|
|
99
99
|
- CLAUDE.md
|
|
100
100
|
- Gemfile
|
|
@@ -127,10 +127,11 @@ files:
|
|
|
127
127
|
- templates/_document.liquid
|
|
128
128
|
- templates/_index.liquid
|
|
129
129
|
- templates/index-style.css
|
|
130
|
-
homepage: https://github.com/
|
|
130
|
+
homepage: https://github.com/metanorma/relaton-cli
|
|
131
131
|
licenses:
|
|
132
132
|
- BSD-2-Clause
|
|
133
133
|
metadata: {}
|
|
134
|
+
post_install_message:
|
|
134
135
|
rdoc_options: []
|
|
135
136
|
require_paths:
|
|
136
137
|
- lib
|
|
@@ -138,14 +139,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
138
139
|
requirements:
|
|
139
140
|
- - ">="
|
|
140
141
|
- !ruby/object:Gem::Version
|
|
141
|
-
version: 3.
|
|
142
|
+
version: 3.3.0
|
|
142
143
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
143
144
|
requirements:
|
|
144
145
|
- - ">="
|
|
145
146
|
- !ruby/object:Gem::Version
|
|
146
147
|
version: '0'
|
|
147
148
|
requirements: []
|
|
148
|
-
rubygems_version:
|
|
149
|
+
rubygems_version: 3.5.22
|
|
150
|
+
signing_key:
|
|
149
151
|
specification_version: 4
|
|
150
152
|
summary: Relaton Command-line Interface
|
|
151
153
|
test_files: []
|
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
|