relaton-cli 1.9.0 → 1.9.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -0
- data/docs/README.adoc +26 -1
- data/lib/relaton/cli/command.rb +9 -0
- data/lib/relaton/cli/data_fetcher.rb +15 -0
- data/lib/relaton/cli/version.rb +1 -1
- data/relaton-cli.gemspec +1 -1
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f15afd456524555eb4054280b44c054324682885cf75d6007df26ac06d7f6382
|
4
|
+
data.tar.gz: 4a6ae9a8f06c07af7c7c71f425780486b0533a17d73a872f7df79655fa2c9a10
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c4b205b32b36c9fa78ed191717fa5e10482f189e989fae1018b2768a972b1b5f22123b624b80c74ef38af348eb5d39c3fcbeb639c5d279bf049dc232dcf1072
|
7
|
+
data.tar.gz: 5752bfbaf2d2eaae483fde7b58d5a11b1f4dfa65ab6b7d2ab68e8c98152f2fe0c55b20cf521b02f9e77120722091cb213c346a6e07051df7b7da7d0ab5d71129
|
data/.rubocop.yml
CHANGED
data/docs/README.adoc
CHANGED
@@ -49,11 +49,36 @@ Fetch the Relaton XML entry corresponding to the document identifier `CODE`.
|
|
49
49
|
|
50
50
|
* `YEAR` is optional, and specifies the year of publication of the standard.
|
51
51
|
* `FORMAT` is optional, and specifies the output format; the recognised values for `FORMAT` are `xml` (default), yaml, `bibtex`.
|
52
|
-
* `TYPE` is optional, specifies the standards class library to be used, that the identifier is part of. The recognised values for `TYPE` are `BIPM
|
52
|
+
* `TYPE` is optional, specifies the standards class library to be used, that the identifier is part of. The recognised values for `TYPE` are `3GPP, BIPM, BSI, CC, CEN, CIE, CN, ECMA, IANA, IEC, IEEE, IETF, IHO, ISO, ITU, NIST, OGC, OMG, UN, W3C`.
|
53
53
|
* `RETRIES` is optional, number of network retries (default 1).
|
54
54
|
* `--all-parts` fetch all parts.
|
55
55
|
* `--keep-year` undated reference should return actual reference with year.
|
56
56
|
|
57
|
+
=== relaton fetch-data
|
58
|
+
|
59
|
+
[source,console]
|
60
|
+
----
|
61
|
+
$ relaton fetch-data DATASET -o DIR -f FORMAT
|
62
|
+
----
|
63
|
+
|
64
|
+
Fetch all the documents from a `DATASET` source and save them to a folder `DIR` in format `FORMAT`.
|
65
|
+
|
66
|
+
Foloowing datasets are availabe:
|
67
|
+
|
68
|
+
* `nist-tech-pubs` - https://raw.githubusercontent.com/usnistgov/NIST-Tech-Pubs/nist-pages/xml/allrecords.xml
|
69
|
+
* `cie-techstreet` - https://www.techstreet.com/cie/searches/31156444
|
70
|
+
* `calconnect-org` - https://standards.calconnect.org/relaton/index.yaml
|
71
|
+
* `ogc-naming-authority` - https://raw.githubusercontent.com/opengeospatial/NamingAuthority/master/incubation/bibliography/bibliography.json
|
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
|
+
* `w3c-rdf` - http://www.w3.org/2002/01/tr-automation/tr.rdf
|
74
|
+
* `iana-registries` - https://github.com/ietf-ribose/iana-registries
|
75
|
+
* `status-smg-3GPP` - ftp://www.3gpp.org/Information/Databases/Spec_Status/
|
76
|
+
|
77
|
+
Options:
|
78
|
+
|
79
|
+
* `DIR` - floder name to store documents (default `./data`).
|
80
|
+
* `FORMAT` - format in which the documents are saved. Possimle formats are: `yaml`, `xml`, `bibxml` (default `yaml`).
|
81
|
+
|
57
82
|
=== relaton extract
|
58
83
|
|
59
84
|
[source,console]
|
data/lib/relaton/cli/command.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require "relaton/cli/relaton_file"
|
2
2
|
require "relaton/cli/xml_convertor"
|
3
3
|
require "relaton/cli/yaml_convertor"
|
4
|
+
require "relaton/cli/data_fetcher"
|
4
5
|
require "relaton/cli/subcommand_collection"
|
5
6
|
require "relaton/cli/subcommand_db"
|
6
7
|
require "fcntl"
|
@@ -141,6 +142,14 @@ module Relaton
|
|
141
142
|
File.write output, result, encoding: "UTF-8"
|
142
143
|
end
|
143
144
|
|
145
|
+
desc "fetch-data SOURCE", "Fetch all the documents from a source"
|
146
|
+
option :output, aliases: :o, desc: "Output dir. Default: ./data/"
|
147
|
+
option :format, aliases: :f, desc: "Output format (yaml, xml, bibxml). Default: yaml"
|
148
|
+
|
149
|
+
def fetch_data(source)
|
150
|
+
DataFetcher.fetch source, options
|
151
|
+
end
|
152
|
+
|
144
153
|
desc "collection SUBCOMMAND", "Collection manipulations"
|
145
154
|
subcommand "collection", SubcommandCollection
|
146
155
|
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Relaton
|
2
|
+
module Cli
|
3
|
+
module DataFetcher
|
4
|
+
def fetch(source, options)
|
5
|
+
processor = Relaton::Registry.instance.find_processor_by_dataset source
|
6
|
+
opts = {}
|
7
|
+
opts[:output] = options[:output] if options[:output]
|
8
|
+
opts[:format] = options[:format] if options[:format]
|
9
|
+
processor.fetch_data source, opts
|
10
|
+
end
|
11
|
+
|
12
|
+
extend DataFetcher
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
data/lib/relaton/cli/version.rb
CHANGED
data/relaton-cli.gemspec
CHANGED
@@ -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", "
|
39
|
+
spec.add_runtime_dependency "relaton", ">= 1.9.1"
|
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.9.
|
4
|
+
version: 1.9.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: byebug
|
@@ -168,16 +168,16 @@ dependencies:
|
|
168
168
|
name: relaton
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
170
170
|
requirements:
|
171
|
-
- - "
|
171
|
+
- - ">="
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version: 1.9.
|
173
|
+
version: 1.9.1
|
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.9.
|
180
|
+
version: 1.9.1
|
181
181
|
- !ruby/object:Gem::Dependency
|
182
182
|
name: thor
|
183
183
|
requirement: !ruby/object:Gem::Requirement
|
@@ -237,6 +237,7 @@ files:
|
|
237
237
|
- lib/relaton/cli.rb
|
238
238
|
- lib/relaton/cli/base_convertor.rb
|
239
239
|
- lib/relaton/cli/command.rb
|
240
|
+
- lib/relaton/cli/data_fetcher.rb
|
240
241
|
- lib/relaton/cli/full_text_search.rb
|
241
242
|
- lib/relaton/cli/relaton_file.rb
|
242
243
|
- lib/relaton/cli/subcommand_collection.rb
|