relaton-cli 1.10.1 → 1.12.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: 8ac7b7923a48a6a0a7dca7b0d89ed9cf5d2de7ee3eeb50f5d1ad0fb107632d8f
4
- data.tar.gz: 317760432a701661e27871055e81a1ce7c2b78f7979535b491e7fdc28ef78d02
3
+ metadata.gz: bb6fd6351e09a16cc3d830099c81578be2236cbc4ed2aa4b720e32f9a16333f3
4
+ data.tar.gz: 3726861e4b8c98caf9f08d524a0d05ca26ee01141cbcad806a4decef4e192050
5
5
  SHA512:
6
- metadata.gz: cc2067442e4a5732c50b431ea83d9b0463856ae2074e9852cfbbfc4c18eef46b8a6dbb08a69ff5fcdea029d6351ac97abf7181c1841591b6b7736a664d5d192f
7
- data.tar.gz: 954de6216cba96efd9cfc795e0d05350a7002b9609a8b96ac6b929a28e4ad742d27cb584bb4a365b5025fb1cdc341cd10a85e870289334b967a3d8b26701d8a0
6
+ metadata.gz: cf7bb3b531cfc04ba5e851e2d3fdf78851e2c3cc477ad14af2d669225a9178efd893d47d3ab18f417fa8ff2ae511513b5f5b7e4127d76359cd4695ecd23ce3e0
7
+ data.tar.gz: fb20933537f140decf9141a331169f762c320365c538c62aebdb58d16cd09d1bb32849caa99c3c8568a762e5c3b083848b695d7d7c7623bedfb1fa56f7fb8c80
@@ -16,7 +16,7 @@ jobs:
16
16
  strategy:
17
17
  fail-fast: false
18
18
  matrix:
19
- ruby: [ '3.0', '2.7', '2.6', '2.5' ]
19
+ ruby: [ '3.0', '2.7', '2.6' ]
20
20
  os: [ ubuntu-latest, windows-latest, macos-latest ]
21
21
  experimental: [ false ]
22
22
  steps:
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.5
10
+ TargetRubyVersion: 2.6
11
11
  Rails:
12
12
  Enabled: true
data/Gemfile CHANGED
@@ -1,6 +1,3 @@
1
- Encoding.default_external = Encoding::UTF_8
2
- Encoding.default_internal = Encoding::UTF_8
3
-
4
1
  source "https://rubygems.org"
5
2
 
6
3
  # Specify your gem's dependencies in gemspec
data/docs/README.adoc CHANGED
@@ -76,6 +76,9 @@ Foloowing datasets are availabe:
76
76
  * `ietf-rfcsubseries` - https://www.rfc-editor.org/rfc-index.xml (`<bcp-entry>`, `<fyi-entry>`, `<std-entry>`)
77
77
  * `ietf-internet-drafts` - looks for the Internet-Drafts dataset in local `./bibxml-ids` directory. The dataset could be downloaded using `rsync -avcizxL rsync.ietf.org::bibxml-ids ./bibxml-ids` command.
78
78
  * `ietf-rfc-entries` - https://www.rfc-editor.org/rfc-index.xml (`<rfc-entry>`)
79
+ * `oasis-open` - https://www.oasis-open.org/standards/
80
+ * `bipm-data-outcomes` - looks for the BIPM dataset in local `./bipm-data-outcomes` directory. The dataset could be downloaded from https://github.com/metanorma/bipm-data-outcomes repository
81
+ * `si-brochure` - looks for the SI-Brochure dataset in local `./bipm-si-brocure` directory. The dataset could be downloaded from https://github.com/metanorma/bipm-si-brochure repository
79
82
 
80
83
  Options:
81
84
 
@@ -194,6 +197,7 @@ root:
194
197
  docid:
195
198
  type: CC
196
199
  id: CC 36000
200
+ primary: true
197
201
  type: standard
198
202
  title:
199
203
  type: main
@@ -207,6 +211,7 @@ root:
207
211
  docid:
208
212
  type: CC
209
213
  id: CC 34000
214
+ primary: true
210
215
  type: standard
211
216
  title:
212
217
  type: main
@@ -420,7 +425,7 @@ $ relaton db fetch_all -e 8 -y 2018
420
425
  <fetched>2021-04-01</fetched>
421
426
  <title type="title-main" format="text/plain" language="en" script="Latn">Principles and rules for the structure and drafting of ISO and IEC documents</title>
422
427
  <uri type="obp">https://www.iec.ch/members_experts/refdocs/iec/isoiecdir2%7Bed8.0.RLV%7Den.pdf</uri>
423
- <docidentifier type="ISO">ISO/IEC DIR 2 IEC</docidentifier>
428
+ <docidentifier type="ISO" primary="true">ISO/IEC DIR 2 IEC</docidentifier>
424
429
  <date type="published">
425
430
  <on>2018-05-01</on>
426
431
  </date>
data/exe/relaton CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  # encoding: UTF-8
3
- #
3
+
4
4
  # resolve bin path, ignoring symlinks
5
5
  require "pathname"
6
6
  bin_file = Pathname.new(__FILE__).realpath
@@ -44,9 +44,9 @@ module Relaton
44
44
 
45
45
  def to_xml(opts = {})
46
46
  options = { bibdata: true, date_format: :full }.merge(
47
- opts.select { |k, _v| k.is_a? Symbol }
47
+ opts.select { |k, _v| k.is_a? Symbol },
48
48
  )
49
- @bibitem.to_xml **options
49
+ @bibitem.to_xml(**options)
50
50
  end
51
51
 
52
52
  def to_h
@@ -69,13 +69,13 @@ module Relaton
69
69
  @bibitem.send meth, *args
70
70
  elsif URL_TYPES.include? meth
71
71
  link = @bibitem.link.detect do |l|
72
- l.type == meth.to_s || meth == :uri && l.type.nil?
72
+ l.type == meth.to_s || (meth == :uri && l.type.nil?)
73
73
  end
74
74
  link&.content&.to_s
75
75
  elsif URL_TYPES.include? meth.match(/^\w+(?==)/).to_s.to_sym
76
76
  /^(?<type>\w+)/ =~ meth
77
77
  link = @bibitem.link.detect do |l|
78
- l.type == type || type == "uri" && l.type.nil?
78
+ l.type == type || (type == "uri" && l.type.nil?)
79
79
  end
80
80
  if link
81
81
  link.content = args[0]
@@ -3,6 +3,11 @@ module Relaton
3
3
  module DataFetcher
4
4
  def fetch(source, options)
5
5
  processor = Relaton::Registry.instance.find_processor_by_dataset source
6
+ unless processor
7
+ warn "[relaton-cli] WARNING: no processor found for #{source}"
8
+ return
9
+ end
10
+
6
11
  opts = {}
7
12
  opts[:output] = options[:output] if options[:output]
8
13
  opts[:format] = options[:format] if options[:format]
@@ -1,5 +1,5 @@
1
1
  module Relaton
2
2
  module Cli
3
- VERSION = "1.10.1".freeze
3
+ VERSION = "1.12.0".freeze
4
4
  end
5
5
  end
data/relaton-cli.gemspec CHANGED
@@ -20,7 +20,7 @@ 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 = ">= 2.5.0"
23
+ spec.required_ruby_version = ">= 2.6.0"
24
24
 
25
25
  spec.add_development_dependency "byebug", "~> 11.0"
26
26
  # spec.add_development_dependency "debase"
@@ -36,7 +36,7 @@ Gem::Specification.new do |spec|
36
36
  spec.add_development_dependency "webmock"
37
37
 
38
38
  spec.add_runtime_dependency "liquid", "~> 4"
39
- spec.add_runtime_dependency "relaton", "~> 1.10.1"
39
+ spec.add_runtime_dependency "relaton", "~> 1.12.0"
40
40
  spec.add_runtime_dependency "thor"
41
41
  spec.add_runtime_dependency "thor-hollaback"
42
42
  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: 1.10.1
4
+ version: 1.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-02-09 00:00:00.000000000 Z
11
+ date: 2022-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug
@@ -170,14 +170,14 @@ dependencies:
170
170
  requirements:
171
171
  - - "~>"
172
172
  - !ruby/object:Gem::Version
173
- version: 1.10.1
173
+ version: 1.12.0
174
174
  type: :runtime
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - "~>"
179
179
  - !ruby/object:Gem::Version
180
- version: 1.10.1
180
+ version: 1.12.0
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: thor
183
183
  requirement: !ruby/object:Gem::Requirement
@@ -264,7 +264,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
264
264
  requirements:
265
265
  - - ">="
266
266
  - !ruby/object:Gem::Version
267
- version: 2.5.0
267
+ version: 2.6.0
268
268
  required_rubygems_version: !ruby/object:Gem::Requirement
269
269
  requirements:
270
270
  - - ">="