relaton-cli 1.11.0 → 1.12.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 129088bf6b85735509a4a0c61d37a29e335d0ea17e882f6d805c4a479db7f4ac
4
- data.tar.gz: 36e75a4ed206eecc11de6281441e998ddb24436c8d941a0747ddc9d4e9ae3c8e
3
+ metadata.gz: bb6fd6351e09a16cc3d830099c81578be2236cbc4ed2aa4b720e32f9a16333f3
4
+ data.tar.gz: 3726861e4b8c98caf9f08d524a0d05ca26ee01141cbcad806a4decef4e192050
5
5
  SHA512:
6
- metadata.gz: c644b905064d58cb44fdafb52a424ad4df0e52fe30cb36cf01634e23d33a74d5a1cb629a7f2ccec171490e665c0d24f26dbdee74a6cfd563f7af5829dcbc18cc
7
- data.tar.gz: 3d954f0a0e9df9740612a754233be15a382460927540834d4719299317e29fb03743448dd292167ab573200f5dcfdc717033c20e59fc4e59a2168a56f658f309
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
@@ -77,6 +77,8 @@ Foloowing datasets are availabe:
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
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
80
82
 
81
83
  Options:
82
84
 
@@ -195,6 +197,7 @@ root:
195
197
  docid:
196
198
  type: CC
197
199
  id: CC 36000
200
+ primary: true
198
201
  type: standard
199
202
  title:
200
203
  type: main
@@ -208,6 +211,7 @@ root:
208
211
  docid:
209
212
  type: CC
210
213
  id: CC 34000
214
+ primary: true
211
215
  type: standard
212
216
  title:
213
217
  type: main
@@ -421,7 +425,7 @@ $ relaton db fetch_all -e 8 -y 2018
421
425
  <fetched>2021-04-01</fetched>
422
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>
423
427
  <uri type="obp">https://www.iec.ch/members_experts/refdocs/iec/isoiecdir2%7Bed8.0.RLV%7Den.pdf</uri>
424
- <docidentifier type="ISO">ISO/IEC DIR 2 IEC</docidentifier>
428
+ <docidentifier type="ISO" primary="true">ISO/IEC DIR 2 IEC</docidentifier>
425
429
  <date type="published">
426
430
  <on>2018-05-01</on>
427
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.11.0".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.11.0"
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.11.0
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-04-10 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.11.0
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.11.0
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
  - - ">="