relaton-cli 1.11.0 → 1.13.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: 67074e0aa3fa8c3f3badfa9cd924ff0f861aaf14fb456f7a051668be827f5f78
4
+ data.tar.gz: b01b4c8710566bbffaa64ffd16ac3ce2f4e5a0d1fa24b1f8924b1d2ada4321db
5
5
  SHA512:
6
- metadata.gz: c644b905064d58cb44fdafb52a424ad4df0e52fe30cb36cf01634e23d33a74d5a1cb629a7f2ccec171490e665c0d24f26dbdee74a6cfd563f7af5829dcbc18cc
7
- data.tar.gz: 3d954f0a0e9df9740612a754233be15a382460927540834d4719299317e29fb03743448dd292167ab573200f5dcfdc717033c20e59fc4e59a2168a56f658f309
6
+ metadata.gz: f2e2eff22baaca6079ffd6ce9fa07abac954db8bbb16138e740c910ccf8f5b5fada43c3809616e2f810fdc0f6eb54e281eff95d29d7b417ec888e6cf778053e1
7
+ data.tar.gz: dcaf6f5e5fe0d708ee02b0671beb0906f6173e8e69e9334f77b41526b3c2ec0c6a5cd506d17226cc15080ee038cc6d7cdac5264b1c7fb3a32c954f70e158ab5f
@@ -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.11.0".freeze
3
+ VERSION = "1.13.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.13.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.13.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-08-21 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.13.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.13.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
  - - ">="