relaton-cli 1.9.0 → 1.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/docs/README.adoc +17 -1
- data/lib/relaton/cli/command.rb +9 -0
- data/lib/relaton/cli/data_fetcher.rb +12 -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: 39535b9c177165d658eeeab7b43592dbf2deb05575b3fec1ecb1502ec564b555
|
4
|
+
data.tar.gz: 8a7a53cc3d078fa0f9b26279f91f59cb521271b5d67d34fc006f81dabc326dca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a0e825551c8ec3fef0fca053352791d4d0747c22cf6fcf190af60e6a2e482bfced0c00623adb5c6a2671879d561337d1c2c6f16e82e034443653f25a3e0ed10
|
7
|
+
data.tar.gz: '0846c248faf4471db8a408a56101ac1ca543418365393b312c85492f281e3d3e085c8b25a7008c7075dad8e9e358e0aea8845e8336b1ef0eae0945aee9fffcf4'
|
data/docs/README.adoc
CHANGED
@@ -54,7 +54,23 @@ Fetch the Relaton XML entry corresponding to the document identifier `CODE`.
|
|
54
54
|
* `--all-parts` fetch all parts.
|
55
55
|
* `--keep-year` undated reference should return actual reference with year.
|
56
56
|
|
57
|
-
=== relaton
|
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
|
+
|
70
|
+
Options:
|
71
|
+
|
72
|
+
* `DIR` - floder name to store documents (default `./data`).
|
73
|
+
* `FORMAT` - format in which the documents are saved. Possimle formats are: `yaml`, `xml` (default `yaml`).
|
58
74
|
|
59
75
|
[source,console]
|
60
76
|
----
|
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). 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
|
|
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.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: 2021-
|
11
|
+
date: 2021-09-03 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
|