relaton-cli 1.10.2 → 1.12.1

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: 15c8d919f29fc32ca8327cd5eac73f9226d3e55cccbc4168b1daada131e2bffc
4
- data.tar.gz: bdeb53cc5eeb6219dd692cc587e6052d8bf44c7371121f7d533f9428384ea27c
3
+ metadata.gz: 8074140a5ba32702090bcbdbfd17d42512851778e987f08334e876774b1c5318
4
+ data.tar.gz: d8ab90de3ab533e3f57656acf1f5a82c031f9953889725db9a0c07351484d58b
5
5
  SHA512:
6
- metadata.gz: a882b232ae25e560e39899938c37af166c31a19c8aba9a7a2f72f0bd57863d5e1cbb18131e47b2449d7671204147f1708ae1248457b9829237f454075a2ecfab
7
- data.tar.gz: 9fad00c31688d270319274bbd53652dc675a61b588930a2c32c6081185c386f0288fb76e517feb3858bdd8902c786ad32c3e8a0b542da3357f230e3d98d83503
6
+ metadata.gz: 1664fe4f25c48f7880894ce33ce42697e9ac7edb55ee324c17bf704e3ce00d3bc39ea349842aab328b23f1312ebc81860273ce648dce9b5201d28e38c1f15f46
7
+ data.tar.gz: 2bfbb9f0b8ce7860bfb141b0eafb7f00c618e9459d5dc6e561ac11cac59f44fcaffb294038f556b3b7eb8788024fe634777895007bfc636bf9e3d836d2060b34
@@ -10,27 +10,4 @@ on:
10
10
 
11
11
  jobs:
12
12
  rake:
13
- name: Test on Ruby ${{ matrix.ruby }} ${{ matrix.os }}
14
- runs-on: ${{ matrix.os }}
15
- continue-on-error: ${{ matrix.experimental }}
16
- strategy:
17
- fail-fast: false
18
- matrix:
19
- ruby: [ '3.0', '2.7', '2.6', '2.5' ]
20
- os: [ ubuntu-latest, windows-latest, macos-latest ]
21
- experimental: [ false ]
22
- steps:
23
- - uses: actions/checkout@v2
24
- with:
25
- submodules: true
26
-
27
- # https://github.com/ruby-debug/debase/issues/89#issuecomment-686827382
28
- - if: matrix.os == 'macos-latest' && matrix.ruby == '2.5'
29
- run: echo BUNDLE_BUILD__DEBASE="--with-cflags=\"-Wno-error=implicit-function-declaration\"" >> $GITHUB_ENV
30
-
31
- - uses: ruby/setup-ruby@v1
32
- with:
33
- ruby-version: ${{ matrix.ruby }}
34
- bundler-cache: true
35
-
36
- - run: bundle exec rake
13
+ uses: relaton/support/.github/workflows/rake.yml@master
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
@@ -71,12 +71,15 @@ Foloowing datasets are availabe:
71
71
  * `ogc-naming-authority` - https://raw.githubusercontent.com/opengeospatial/NamingAuthority/master/incubation/bibliography/bibliography.json
72
72
  * `ieee-rawbib` - looks for the IEEE dataset in local `./ieee-rawbib` directory. The dataset could be downloaded from https://github.com/ietf-ribose/ieee-rawbib repository
73
73
  * `w3c-rdf` - http://www.w3.org/2002/01/tr-automation/tr.rdf
74
+ * `w3c-tr-archive` - looks for the W3C archive dataset in local `./w3c-tr-archive` directory. The dataset could be downloaded from https://github.com/relaton/w3c-tr-archive repository
74
75
  * `iana-registries` - https://github.com/ietf-ribose/iana-registries
75
76
  * `status-smg-3GPP` - ftp://www.3gpp.org/Information/Databases/Spec_Status/
76
77
  * `ietf-rfcsubseries` - https://www.rfc-editor.org/rfc-index.xml (`<bcp-entry>`, `<fyi-entry>`, `<std-entry>`)
77
78
  * `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
79
  * `ietf-rfc-entries` - https://www.rfc-editor.org/rfc-index.xml (`<rfc-entry>`)
79
80
  * `oasis-open` - https://www.oasis-open.org/standards/
81
+ * `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
82
+ * `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
83
 
81
84
  Options:
82
85
 
@@ -195,6 +198,7 @@ root:
195
198
  docid:
196
199
  type: CC
197
200
  id: CC 36000
201
+ primary: true
198
202
  type: standard
199
203
  title:
200
204
  type: main
@@ -208,6 +212,7 @@ root:
208
212
  docid:
209
213
  type: CC
210
214
  id: CC 34000
215
+ primary: true
211
216
  type: standard
212
217
  title:
213
218
  type: main
@@ -421,7 +426,7 @@ $ relaton db fetch_all -e 8 -y 2018
421
426
  <fetched>2021-04-01</fetched>
422
427
  <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
428
  <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>
429
+ <docidentifier type="ISO" primary="true">ISO/IEC DIR 2 IEC</docidentifier>
425
430
  <date type="published">
426
431
  <on>2018-05-01</on>
427
432
  </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]
@@ -196,7 +196,7 @@ module Relaton
196
196
  case format
197
197
  when "yaml", "yml" then doc.to_hash.to_yaml
198
198
  when "bibtex" then doc.to_bibtex
199
- else doc.to_xml
199
+ else doc.to_xml bibdata: true
200
200
  end
201
201
  end
202
202
 
@@ -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.2".freeze
3
+ VERSION = "1.12.1".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.3"
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.2
4
+ version: 1.12.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: 2022-03-18 00:00:00.000000000 Z
11
+ date: 2022-07-27 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.3
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.3
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
  - - ">="