relaton-cli 1.15.1 → 1.15.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +1 -0
- data/.github/workflows/release.yml +3 -2
- data/Gemfile +6 -0
- data/docs/README.adoc +33 -0
- data/lib/relaton/cli/command.rb +45 -43
- data/lib/relaton/cli/version.rb +1 -1
- data/lib/relaton/cli.rb +14 -0
- data/relaton-cli.gemspec +3 -10
- metadata +5 -75
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee715fcdbc10e796d236363c05c45f3d0a50f1a64f542274a25e8abf8909b996
|
4
|
+
data.tar.gz: 23e164c5e9907b0d1a2fe917e4a65b1e7f0d2740e9caaaf0acb5804692cecddc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89f6d0068c10ef1983ce9ab07c53fb389396b2ea37a9c47953d336c07cf3feb3d193a553658055636e740b6b742af3e384fe97cec0dec72c77e88069a87aa6b8
|
7
|
+
data.tar.gz: a4f5ba155868d820b9ee3608c0d2eb746972c33857a4a1c20955cd6bdcfcea2fc63687949a0c5735ce7998ff9ca1a6760e3add59ac62436c25fa70dbc99744e8
|
data/.github/workflows/rake.yml
CHANGED
data/Gemfile
CHANGED
data/docs/README.adoc
CHANGED
@@ -81,6 +81,7 @@ The following datasets are available:
|
|
81
81
|
* `oasis-open` - https://www.oasis-open.org/standards/
|
82
82
|
* `bipm-data-outcomes` - looks for the BIPM dataset in the local `./bipm-data-outcomes` directory. The dataset could be downloaded from https://github.com/metanorma/bipm-data-outcomes repository
|
83
83
|
* `si-brochure` - looks for the SI-Brochure dataset in the local `./bipm-si-brocure` directory. The dataset could be downloaded from https://github.com/metanorma/bipm-si-brochure repository
|
84
|
+
* `ecma-standards` - https://www.ecma-international.org/publications/standards/
|
84
85
|
|
85
86
|
Options:
|
86
87
|
|
@@ -254,6 +255,38 @@ $ relaton convert XML -f FORMAT -o OUTPUT-FILE
|
|
254
255
|
|
255
256
|
Convert a Relaton XML document into YAML, AsciiBib, or BibTex format. Allowed -f or --format options are yaml, asciibib, bibtex. If the option -o or --output is omitted then a new file will be created in the folder where the original file is, with the same name but another appropriated extension.
|
256
257
|
|
258
|
+
=== relaton version
|
259
|
+
----
|
260
|
+
$ relaton version
|
261
|
+
CLI => 1.15.2
|
262
|
+
relaton => 1.15.1
|
263
|
+
relaton-bib => 1.14.11
|
264
|
+
relaton-iso-bib => 1.14.0
|
265
|
+
relaton-gb => 1.14.0
|
266
|
+
relaton-iec => 1.14.3
|
267
|
+
relaton-ietf => 1.14.3
|
268
|
+
relaton-iso => 1.15.1
|
269
|
+
relaton-itu => 1.14.1
|
270
|
+
relaton-nist => 1.14.3
|
271
|
+
relaton-ogc => 1.14.1
|
272
|
+
relaton-calconnect => 1.14.0
|
273
|
+
relaton-omg => 1.14.0
|
274
|
+
relaton-un => 1.14.1
|
275
|
+
relaton-w3c => 1.14.1
|
276
|
+
relaton-ieee => 1.14.6
|
277
|
+
relaton-iho => 1.14.2
|
278
|
+
relaton-bipm => 1.14.6
|
279
|
+
relaton-ecma => 1.14.1
|
280
|
+
relaton-cie => 1.14.0
|
281
|
+
relaton-bsi => 1.14.5
|
282
|
+
relaton-cen => 1.14.0
|
283
|
+
relaton-iana => 1.14.1
|
284
|
+
relaton-3gpp => 1.14.3
|
285
|
+
relaton-oasis => 1.14.2
|
286
|
+
relaton-doi => 1.14.3
|
287
|
+
relaton-jis => 1.14.1
|
288
|
+
----
|
289
|
+
|
257
290
|
=== relaton collection
|
258
291
|
|
259
292
|
The `relaton collection` is a set of subcommands for collections manipulations.
|
data/lib/relaton/cli/command.rb
CHANGED
@@ -13,18 +13,23 @@ module Relaton
|
|
13
13
|
class_before :relaton_config
|
14
14
|
class_option :verbose, aliases: :v, type: :boolean, desc: "Output warnings"
|
15
15
|
|
16
|
+
desc "version", "Show Relaton version"
|
17
|
+
|
18
|
+
def version
|
19
|
+
Relaton::Cli.version
|
20
|
+
end
|
21
|
+
|
16
22
|
desc "fetch CODE", "Fetch Relaton XML for Standard identifier CODE"
|
17
|
-
option :type, aliases: :t, desc: "Type of standard to "\
|
23
|
+
option :type, aliases: :t, desc: "Type of standard to " \
|
18
24
|
"get bibliographic entry for"
|
19
|
-
option :format, aliases: :f, desc: "Output format (xml, yaml, bibtex). "\
|
25
|
+
option :format, aliases: :f, desc: "Output format (xml, yaml, bibtex). " \
|
20
26
|
"Default xml."
|
21
|
-
option :year, aliases: :y, type: :numeric, desc: "Year the standard was "
|
22
|
-
"published"
|
27
|
+
option :year, aliases: :y, type: :numeric, desc: "Year the standard was published"
|
23
28
|
option :"all-parts", type: :boolean, desc: "Fetch all parts"
|
24
|
-
option :"keep-year", type: :boolean, desc: "Undated reference should "\
|
29
|
+
option :"keep-year", type: :boolean, desc: "Undated reference should " \
|
25
30
|
"return actual reference with year"
|
26
|
-
option :retries, aliases: :r, type: :numeric, desc: "Number of network "\
|
27
|
-
|
31
|
+
option :retries, aliases: :r, type: :numeric, desc: "Number of network " \
|
32
|
+
"retries. Default 1."
|
28
33
|
|
29
34
|
def fetch(code)
|
30
35
|
io = IO.new($stdout.fcntl(::Fcntl::F_DUPFD), mode: "w:UTF-8")
|
@@ -33,43 +38,42 @@ module Relaton
|
|
33
38
|
|
34
39
|
desc "extract Metanorma-XML-File / Directory Relaton-XML-Directory",
|
35
40
|
"Extract Relaton XML from Metanorma XML file / directory"
|
36
|
-
option :extension, aliases: :x, default: "rxl", desc: "File extension "\
|
37
|
-
|
41
|
+
option :extension, aliases: :x, default: "rxl", desc: "File extension of Relaton XML files, " \
|
42
|
+
"defaults to 'rxl'"
|
38
43
|
|
39
44
|
def extract(source_dir, outdir)
|
40
45
|
Relaton::Cli::RelatonFile.extract(source_dir, outdir, options)
|
41
46
|
end
|
42
47
|
|
43
|
-
desc "concatenate SOURCE-DIR COLLECTION-FILE",
|
44
|
-
|
48
|
+
desc "concatenate SOURCE-DIR COLLECTION-FILE",
|
49
|
+
"Concatenate entries in DIRECTORY (containing Relaton-XML or YAML) into a Relaton Collection"
|
45
50
|
option :title, aliases: :t, desc: "Title of resulting Relaton collection"
|
46
|
-
option :organization, aliases: :g, desc: "Organization owner of Relaton "
|
47
|
-
|
48
|
-
|
49
|
-
"Relaton file, defaults to 'rxl'"
|
51
|
+
option :organization, aliases: :g, desc: "Organization owner of Relaton collection"
|
52
|
+
option :extension, aliases: :x, desc: "File extension of destination " \
|
53
|
+
"Relaton file, defaults to 'rxl'"
|
50
54
|
|
51
55
|
def concatenate(source_dir, outfile)
|
52
56
|
Relaton::Cli::RelatonFile.concatenate(source_dir, outfile, options)
|
53
57
|
end
|
54
58
|
|
55
|
-
desc "split Relaton-Collection-File Relaton-XML-Directory",
|
56
|
-
|
57
|
-
option :extension, aliases: :x, default: "rxl", desc: "File extension "\
|
58
|
-
|
59
|
+
desc "split Relaton-Collection-File Relaton-XML-Directory",
|
60
|
+
"Split a Relaton Collection into multiple files"
|
61
|
+
option :extension, aliases: :x, default: "rxl", desc: "File extension of Relaton XML files, " \
|
62
|
+
"defaults to 'rxl'"
|
59
63
|
|
60
64
|
def split(source, outdir)
|
61
65
|
Relaton::Cli::RelatonFile.split(source, outdir, options)
|
62
66
|
end
|
63
67
|
|
64
|
-
desc "yaml2xml YAML", "Convert Relaton YAML into Relaton Collection XML "\
|
68
|
+
desc "yaml2xml YAML", "Convert Relaton YAML into Relaton Collection XML " \
|
65
69
|
"or separate files"
|
66
|
-
option :extension, aliases: :x, default: "rxl", desc: "File extension "\
|
67
|
-
|
68
|
-
option :prefix, aliases: :p, desc: "Filename prefix of individual "\
|
70
|
+
option :extension, aliases: :x, default: "rxl", desc: "File extension of Relaton XML files, " \
|
71
|
+
"defaults to 'rxl'"
|
72
|
+
option :prefix, aliases: :p, desc: "Filename prefix of individual " \
|
69
73
|
"Relaton XML files, defaults to empty"
|
70
|
-
option :outdir, aliases: :o, desc: "Output to the specified directory "\
|
71
|
-
|
72
|
-
option :require, aliases: :r, type: :array, desc: "Require LIBRARY "\
|
74
|
+
option :outdir, aliases: :o, desc: "Output to the specified directory " \
|
75
|
+
"with individual Relaton Bibdata XML files"
|
76
|
+
option :require, aliases: :r, type: :array, desc: "Require LIBRARY " \
|
73
77
|
"prior to execution"
|
74
78
|
option :overwrite, aliases: :f, type: :boolean, default: false,
|
75
79
|
desc: "Overwrite the existing file"
|
@@ -78,15 +82,15 @@ module Relaton
|
|
78
82
|
Relaton::Cli::YAMLConvertor.to_xml(filename, options)
|
79
83
|
end
|
80
84
|
|
81
|
-
desc "xml2yaml XML", "Convert Relaton XML into Relaton Bibdata / "\
|
85
|
+
desc "xml2yaml XML", "Convert Relaton XML into Relaton Bibdata / " \
|
82
86
|
"Bibcollection YAML (and separate files)"
|
83
|
-
option :extension, aliases: :x, default: "yaml", desc: "File extension "\
|
84
|
-
|
85
|
-
option :prefix, aliases: :p, desc: "Filename prefix of Relaton XML "\
|
87
|
+
option :extension, aliases: :x, default: "yaml", desc: "File extension of Relaton YAML files, " \
|
88
|
+
"defaults to 'yaml'"
|
89
|
+
option :prefix, aliases: :p, desc: "Filename prefix of Relaton XML " \
|
86
90
|
"files, defaults to empty"
|
87
|
-
option :outdir, aliases: :o, desc: "Output to the specified directory "\
|
91
|
+
option :outdir, aliases: :o, desc: "Output to the specified directory " \
|
88
92
|
"with individual Relaton Bibdata YAML files"
|
89
|
-
option :require, aliases: :r, type: :array, desc: "Require LIBRARY "\
|
93
|
+
option :require, aliases: :r, type: :array, desc: "Require LIBRARY " \
|
90
94
|
"prior to execution"
|
91
95
|
option :overwrite, aliases: :f, type: :boolean, default: false,
|
92
96
|
desc: "Overwrite the existing file"
|
@@ -95,12 +99,11 @@ module Relaton
|
|
95
99
|
Relaton::Cli::XMLConvertor.to_yaml(filename, options)
|
96
100
|
end
|
97
101
|
|
98
|
-
desc "xml2html RELATON-INDEX-XML", "Convert Relaton Collection XML into "
|
99
|
-
|
100
|
-
option :stylesheet, aliases: :s, desc: "Stylesheet file path for "\
|
102
|
+
desc "xml2html RELATON-INDEX-XML", "Convert Relaton Collection XML into HTML"
|
103
|
+
option :stylesheet, aliases: :s, desc: "Stylesheet file path for " \
|
101
104
|
"rendering HTML index"
|
102
|
-
option :templatedir, aliases: :t, desc: "Liquid template directory for "\
|
103
|
-
|
105
|
+
option :templatedir, aliases: :t, desc: "Liquid template directory for " \
|
106
|
+
"rendering Relaton items and collection"
|
104
107
|
option :overwrite, aliases: :f, type: :boolean, default: false,
|
105
108
|
desc: "Overwrite the existing file"
|
106
109
|
|
@@ -108,12 +111,12 @@ module Relaton
|
|
108
111
|
Relaton::Cli::XMLConvertor.to_html(file, style, template)
|
109
112
|
end
|
110
113
|
|
111
|
-
desc "yaml2html RELATON-INDEX-YAML", "Concatenate Relaton Collection "\
|
114
|
+
desc "yaml2html RELATON-INDEX-YAML", "Concatenate Relaton Collection " \
|
112
115
|
"YAML into HTML"
|
113
|
-
option :stylesheet, aliases: :s, desc: "Stylesheet file path for "\
|
116
|
+
option :stylesheet, aliases: :s, desc: "Stylesheet file path for " \
|
114
117
|
"rendering HTML index"
|
115
|
-
option :templatedir, aliases: :t, desc: "Liquid template directory for "\
|
116
|
-
|
118
|
+
option :templatedir, aliases: :t, desc: "Liquid template directory for " \
|
119
|
+
"rendering Relaton items and collection"
|
117
120
|
option :overwrite, aliases: :f, type: :boolean, default: false,
|
118
121
|
desc: "Overwrite the existing file"
|
119
122
|
|
@@ -122,8 +125,7 @@ module Relaton
|
|
122
125
|
end
|
123
126
|
|
124
127
|
desc "convert XML", "Convert Relaton XML document"
|
125
|
-
option :format, aliases: :f, required: true, desc: "Output format "
|
126
|
-
"(yaml, bibtex, asciibib)"
|
128
|
+
option :format, aliases: :f, required: true, desc: "Output format (yaml, bibtex, asciibib)"
|
127
129
|
option :output, aliases: :o, desc: "Output to the specified file"
|
128
130
|
|
129
131
|
def convert(file) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
|
data/lib/relaton/cli/version.rb
CHANGED
data/lib/relaton/cli.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require "thor"
|
2
2
|
require "thor/hollaback"
|
3
3
|
require "relaton"
|
4
|
+
require "relaton/cli/version"
|
4
5
|
require_relative "cli/command"
|
5
6
|
|
6
7
|
module Relaton
|
@@ -37,6 +38,19 @@ module Relaton
|
|
37
38
|
end
|
38
39
|
|
39
40
|
class << self
|
41
|
+
def version
|
42
|
+
registry = Relaton::Registry.instance
|
43
|
+
puts "CLI => #{Relaton::Cli::VERSION}"
|
44
|
+
puts "relaton => #{Relaton::VERSION}"
|
45
|
+
puts "relaton-bib => #{RelatonBib::VERSION}"
|
46
|
+
puts "relaton-iso-bib => #{RelatonIsoBib::VERSION}"
|
47
|
+
registry.processors.each_key do |k|
|
48
|
+
klass = "#{k.to_s.split('_').map(&:capitalize).join}::VERSION"
|
49
|
+
version = Kernel.const_get(klass)
|
50
|
+
puts "#{k.to_s.sub('_', '-')} => #{version}"
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
40
54
|
def start(arguments)
|
41
55
|
Relaton::Cli::Command.start(arguments)
|
42
56
|
end
|
data/relaton-cli.gemspec
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.authors = ["Ribose Inc."]
|
9
9
|
spec.email = ["open.source@ribose.com"]
|
10
10
|
|
11
|
-
spec.summary =
|
12
|
-
spec.description =
|
11
|
+
spec.summary = "Relaton Command-line Interface"
|
12
|
+
spec.description = "Relaton Command-line Interface"
|
13
13
|
spec.homepage = "https://github.com/metanorma/relaton-cli"
|
14
14
|
spec.license = "BSD-2-Clause"
|
15
15
|
|
@@ -23,20 +23,13 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.required_ruby_version = ">= 2.6.0"
|
24
24
|
|
25
25
|
spec.add_development_dependency "byebug", "~> 11.0"
|
26
|
-
# spec.add_development_dependency "debase"
|
27
26
|
spec.add_development_dependency "equivalent-xml", "~> 0.6"
|
28
|
-
spec.add_development_dependency "pry"
|
29
|
-
spec.add_development_dependency "rake"
|
30
27
|
spec.add_development_dependency "rspec", "~> 3.0"
|
31
28
|
spec.add_development_dependency "rspec-command", "~> 1.0.3"
|
32
29
|
spec.add_development_dependency "rspec-core", "~> 3.4"
|
33
|
-
# spec.add_development_dependency "ruby-debug-ide"
|
34
|
-
spec.add_development_dependency "simplecov"
|
35
|
-
spec.add_development_dependency "vcr"
|
36
|
-
spec.add_development_dependency "webmock"
|
37
30
|
|
38
31
|
spec.add_runtime_dependency "liquid", "~> 5"
|
39
|
-
spec.add_runtime_dependency "relaton", "~> 1.15.
|
32
|
+
spec.add_runtime_dependency "relaton", "~> 1.15.1"
|
40
33
|
spec.add_runtime_dependency "thor"
|
41
34
|
spec.add_runtime_dependency "thor-hollaback"
|
42
35
|
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.15.
|
4
|
+
version: 1.15.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: byebug
|
@@ -38,34 +38,6 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0.6'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: pry
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rake
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
41
|
- !ruby/object:Gem::Dependency
|
70
42
|
name: rspec
|
71
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -108,48 +80,6 @@ dependencies:
|
|
108
80
|
- - "~>"
|
109
81
|
- !ruby/object:Gem::Version
|
110
82
|
version: '3.4'
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: simplecov
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - ">="
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '0'
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - ">="
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: '0'
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: vcr
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
- - ">="
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: '0'
|
132
|
-
type: :development
|
133
|
-
prerelease: false
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
135
|
-
requirements:
|
136
|
-
- - ">="
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
version: '0'
|
139
|
-
- !ruby/object:Gem::Dependency
|
140
|
-
name: webmock
|
141
|
-
requirement: !ruby/object:Gem::Requirement
|
142
|
-
requirements:
|
143
|
-
- - ">="
|
144
|
-
- !ruby/object:Gem::Version
|
145
|
-
version: '0'
|
146
|
-
type: :development
|
147
|
-
prerelease: false
|
148
|
-
version_requirements: !ruby/object:Gem::Requirement
|
149
|
-
requirements:
|
150
|
-
- - ">="
|
151
|
-
- !ruby/object:Gem::Version
|
152
|
-
version: '0'
|
153
83
|
- !ruby/object:Gem::Dependency
|
154
84
|
name: liquid
|
155
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -170,14 +100,14 @@ dependencies:
|
|
170
100
|
requirements:
|
171
101
|
- - "~>"
|
172
102
|
- !ruby/object:Gem::Version
|
173
|
-
version: 1.15.
|
103
|
+
version: 1.15.1
|
174
104
|
type: :runtime
|
175
105
|
prerelease: false
|
176
106
|
version_requirements: !ruby/object:Gem::Requirement
|
177
107
|
requirements:
|
178
108
|
- - "~>"
|
179
109
|
- !ruby/object:Gem::Version
|
180
|
-
version: 1.15.
|
110
|
+
version: 1.15.1
|
181
111
|
- !ruby/object:Gem::Dependency
|
182
112
|
name: thor
|
183
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -271,7 +201,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
271
201
|
- !ruby/object:Gem::Version
|
272
202
|
version: '0'
|
273
203
|
requirements: []
|
274
|
-
rubygems_version: 3.
|
204
|
+
rubygems_version: 3.3.26
|
275
205
|
signing_key:
|
276
206
|
specification_version: 4
|
277
207
|
summary: Relaton Command-line Interface
|