metanorma-cli 1.2.11.1 → 1.2.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +121 -85
- data/a +2 -1
- data/a.json +33 -0
- data/lib/metanorma/cli.rb +23 -1
- data/lib/metanorma/cli/command.rb +24 -5
- data/lib/metanorma/cli/setup.rb +80 -0
- data/lib/metanorma/cli/ui.rb +2 -2
- data/lib/metanorma/cli/version.rb +1 -1
- data/metanorma-cli.gemspec +5 -2
- data/test.rxl +2 -1
- metadata +48 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae83cca76d9f5b0ead5178abcafe7751c18af9115626988fd8ba1799eb0997e5
|
4
|
+
data.tar.gz: e7cf1052b491a62a84e8701570883284e3b1c12921a801fa57253db7151b406a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf6a47b5007b3acb3b447c96013ede26d49b7c37bb9482617b24b6c2588a8d5afe4668bd1e9e60caa11ad89374878549423931dcb08ea23203acae24c30a4c0a
|
7
|
+
data.tar.gz: fddb7fb5ff6042bda63a16e30624e274408aa8e965caafb6448cb078b1deebb70c0872722998fba473b0159482acbbacf1bf36781eecddb6b0b8e481fc3124f5
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
metanorma-cli (1.2.
|
4
|
+
metanorma-cli (1.2.13.2)
|
5
|
+
fontist (~> 0.2.0)
|
5
6
|
git (~> 1.5)
|
6
7
|
isodoc (~> 1.0.0)
|
7
8
|
metanorma (~> 1.0.0)
|
@@ -11,12 +12,13 @@ PATH
|
|
11
12
|
metanorma-generic (~> 1.4.0)
|
12
13
|
metanorma-iec (~> 1.0.0)
|
13
14
|
metanorma-ietf (~> 2.0.0)
|
15
|
+
metanorma-iho (~> 0.0.1)
|
14
16
|
metanorma-iso (~> 1.3.0)
|
15
17
|
metanorma-itu (~> 1.0.0)
|
16
18
|
metanorma-m3d (~> 1.3.0)
|
17
19
|
metanorma-nist (~> 1.0.0)
|
18
20
|
metanorma-ogc (~> 1.0.0)
|
19
|
-
metanorma-standoc (~> 1.
|
21
|
+
metanorma-standoc (~> 1.4.0)
|
20
22
|
metanorma-un (~> 0.3.1)
|
21
23
|
relaton-cli (>= 0.8.2)
|
22
24
|
thor (~> 0.20.3)
|
@@ -33,20 +35,29 @@ GEM
|
|
33
35
|
byebug (10.0.2)
|
34
36
|
camertron-eprun (1.1.1)
|
35
37
|
cldr-plurals-runtime-rb (1.0.1)
|
36
|
-
cnccs (0.1.
|
38
|
+
cnccs (0.1.6)
|
39
|
+
coderay (1.1.3)
|
37
40
|
concurrent-ruby (1.1.6)
|
38
41
|
diff-lcs (1.3)
|
39
42
|
domain_name (0.5.20190701)
|
40
43
|
unf (>= 0.0.5, < 1.0.0)
|
44
|
+
down (5.1.1)
|
45
|
+
addressable (~> 2.5)
|
41
46
|
equivalent-xml (0.6.0)
|
42
47
|
nokogiri (>= 1.4.3)
|
43
48
|
faraday (1.0.1)
|
44
49
|
multipart-post (>= 1.2, < 3)
|
45
|
-
ffi (1.
|
50
|
+
ffi (1.13.1)
|
51
|
+
ffi-compiler2 (2.0.0)
|
52
|
+
ffi (>= 1.0.0)
|
53
|
+
rake
|
54
|
+
fontist (0.2.0)
|
55
|
+
down (~> 5.0)
|
56
|
+
libmspack (~> 0.1.0)
|
46
57
|
gb-agencies (0.0.6)
|
47
|
-
git (1.
|
58
|
+
git (1.7.0)
|
48
59
|
rchardet (~> 1.8)
|
49
|
-
html2doc (1.0.
|
60
|
+
html2doc (1.0.2)
|
50
61
|
asciimath (~> 1.0.9)
|
51
62
|
htmlentities (~> 4.3.4)
|
52
63
|
image_size
|
@@ -62,7 +73,7 @@ GEM
|
|
62
73
|
image_size (2.0.2)
|
63
74
|
iso-639 (0.3.5)
|
64
75
|
iso639 (1.3.2)
|
65
|
-
isodoc (1.0.
|
76
|
+
isodoc (1.0.29)
|
66
77
|
asciimath
|
67
78
|
html2doc (~> 1.0.0)
|
68
79
|
htmlentities (~> 4.3.4)
|
@@ -71,173 +82,196 @@ GEM
|
|
71
82
|
nokogiri (>= 1.10.4)
|
72
83
|
rake (~> 12.0)
|
73
84
|
roman-numerals
|
74
|
-
sassc (~> 2.
|
85
|
+
sassc (~> 2.4.0)
|
75
86
|
thread_safe
|
76
87
|
uuidtools
|
77
88
|
isoics (0.1.8)
|
78
89
|
latex-decode (0.3.1)
|
90
|
+
libmspack (0.1.0)
|
91
|
+
ffi
|
92
|
+
ffi-compiler2 (>= 2.0.0)
|
79
93
|
liquid (4.0.3)
|
80
94
|
mathml2asciimath (0.0.10)
|
81
95
|
htmlentities (~> 4.3.4)
|
82
96
|
nokogiri (>= 1.10.4)
|
83
|
-
metanorma (1.0.
|
97
|
+
metanorma (1.0.6)
|
84
98
|
asciidoctor
|
85
99
|
htmlentities
|
100
|
+
mn2pdf (~> 1)
|
86
101
|
nokogiri
|
87
|
-
metanorma-csa (1.4.
|
102
|
+
metanorma-csa (1.4.12)
|
88
103
|
htmlentities (~> 4.3.4)
|
89
104
|
image_size
|
90
105
|
isodoc (~> 1.0.0)
|
91
|
-
metanorma-standoc (~> 1.
|
106
|
+
metanorma-standoc (~> 1.4.0)
|
92
107
|
mime-types
|
93
108
|
ruby-jing
|
94
109
|
thread_safe
|
95
110
|
uuidtools
|
96
|
-
metanorma-csd (1.3.
|
111
|
+
metanorma-csd (1.3.23)
|
97
112
|
isodoc (~> 1.0.0)
|
98
|
-
metanorma-standoc (~> 1.
|
99
|
-
metanorma-gb (1.3.
|
113
|
+
metanorma-standoc (~> 1.4.0)
|
114
|
+
metanorma-gb (1.3.27)
|
100
115
|
gb-agencies (~> 0.0.4)
|
101
116
|
htmlentities (~> 4.3.4)
|
102
117
|
isodoc (~> 1.0.0)
|
103
118
|
metanorma-iso (~> 1.3.0)
|
104
119
|
twitter_cldr (~> 4.4.4)
|
105
|
-
metanorma-generic (1.4.
|
120
|
+
metanorma-generic (1.4.10)
|
106
121
|
htmlentities (~> 4.3.4)
|
107
122
|
isodoc (~> 1.0.0)
|
108
|
-
metanorma-standoc (~> 1.
|
123
|
+
metanorma-standoc (~> 1.4.0)
|
109
124
|
ruby-jing
|
110
|
-
metanorma-iec (1.0.
|
125
|
+
metanorma-iec (1.0.9)
|
111
126
|
isodoc (~> 1.0.0)
|
112
127
|
metanorma-iso (~> 1.3.0)
|
113
128
|
ruby-jing
|
114
|
-
metanorma-ietf (2.0.
|
129
|
+
metanorma-ietf (2.0.13)
|
115
130
|
isodoc (~> 1.0.0)
|
116
131
|
mathml2asciimath
|
117
|
-
metanorma-standoc (~> 1.
|
118
|
-
metanorma-
|
132
|
+
metanorma-standoc (~> 1.4.0)
|
133
|
+
metanorma-iho (0.0.3)
|
134
|
+
htmlentities (~> 4.3.4)
|
135
|
+
isodoc (~> 1.0.0)
|
136
|
+
metanorma-generic (~> 1.4.0)
|
137
|
+
metanorma-standoc (~> 1.4.0)
|
138
|
+
metanorma-iso (1.3.27)
|
119
139
|
isodoc (~> 1.0.0)
|
120
|
-
metanorma-standoc (~> 1.
|
140
|
+
metanorma-standoc (~> 1.4.0)
|
141
|
+
mn2sts (~> 1.2.0)
|
121
142
|
ruby-jing
|
122
|
-
|
143
|
+
tokenizer (~> 0.3.0)
|
144
|
+
twitter_cldr
|
145
|
+
metanorma-itu (1.0.18)
|
123
146
|
htmlentities (~> 4.3.4)
|
124
147
|
isodoc (~> 1.0.0)
|
125
|
-
metanorma-standoc (~> 1.
|
148
|
+
metanorma-standoc (~> 1.4.0)
|
126
149
|
ruby-jing
|
127
|
-
metanorma-m3d (1.3.
|
150
|
+
metanorma-m3d (1.3.22)
|
128
151
|
asciimath
|
129
152
|
htmlentities (~> 4.3.4)
|
130
153
|
image_size
|
131
154
|
isodoc (~> 1.0.0)
|
132
|
-
metanorma-standoc (~> 1.
|
155
|
+
metanorma-standoc (~> 1.4.0)
|
133
156
|
mime-types
|
134
157
|
ruby-jing
|
135
158
|
thread_safe
|
136
159
|
uuidtools
|
137
|
-
metanorma-nist (1.0.
|
160
|
+
metanorma-nist (1.0.10)
|
138
161
|
htmlentities (~> 4.3.4)
|
162
|
+
iso-639
|
139
163
|
isodoc (~> 1.0.0)
|
140
|
-
metanorma-standoc (~> 1.
|
164
|
+
metanorma-standoc (~> 1.4.0)
|
141
165
|
ruby-jing
|
142
166
|
twitter_cldr
|
143
167
|
tzinfo-data
|
144
|
-
metanorma-ogc (1.0.
|
168
|
+
metanorma-ogc (1.0.9)
|
145
169
|
htmlentities (~> 4.3.4)
|
146
170
|
iso-639
|
147
171
|
isodoc (~> 1.0.20)
|
148
|
-
metanorma-standoc (~> 1.
|
172
|
+
metanorma-standoc (~> 1.4.0)
|
149
173
|
ruby-jing
|
150
|
-
metanorma-standoc (1.
|
174
|
+
metanorma-standoc (1.4.1)
|
151
175
|
asciidoctor (~> 2.0.0)
|
152
176
|
concurrent-ruby
|
153
177
|
iev (~> 0.2.1)
|
154
178
|
isodoc (~> 1.0.20)
|
155
179
|
mathml2asciimath
|
156
180
|
mimemagic
|
157
|
-
relaton (~>
|
158
|
-
relaton-iev (~>
|
181
|
+
relaton (~> 1.1.0)
|
182
|
+
relaton-iev (~> 1.0.0)
|
159
183
|
ruby-jing
|
160
184
|
sterile (~> 1.0.14)
|
161
185
|
unicode2latex (~> 0.0.1)
|
162
|
-
metanorma-un (0.3.
|
186
|
+
metanorma-un (0.3.11)
|
163
187
|
htmlentities (~> 4.3.4)
|
164
188
|
iso-639
|
165
189
|
isodoc (~> 1.0.0)
|
166
|
-
metanorma-standoc (~> 1.
|
190
|
+
metanorma-standoc (~> 1.4.0)
|
167
191
|
roman-numerals
|
168
192
|
ruby-jing
|
169
193
|
twitter_cldr
|
194
|
+
method_source (1.0.0)
|
170
195
|
mime-types (3.3.1)
|
171
196
|
mime-types-data (~> 3.2015)
|
172
|
-
mime-types-data (3.
|
173
|
-
mimemagic (0.3.
|
197
|
+
mime-types-data (3.2020.0512)
|
198
|
+
mimemagic (0.3.5)
|
174
199
|
mini_portile2 (2.4.0)
|
175
200
|
mixlib-shellout (2.4.4)
|
201
|
+
mn2pdf (1.14)
|
202
|
+
mn2sts (1.2.0)
|
176
203
|
multipart-post (2.1.1)
|
177
204
|
nokogiri (1.10.9)
|
178
205
|
mini_portile2 (~> 2.4.0)
|
179
206
|
optout (0.0.2)
|
180
|
-
|
207
|
+
pry (0.13.1)
|
208
|
+
coderay (~> 1.1)
|
209
|
+
method_source (~> 1.0)
|
210
|
+
public_suffix (4.0.5)
|
181
211
|
rake (12.3.3)
|
182
212
|
rchardet (1.8.0)
|
183
|
-
relaton (
|
184
|
-
relaton-calconnect (~>
|
185
|
-
relaton-gb (~>
|
186
|
-
relaton-iec (~>
|
187
|
-
relaton-
|
188
|
-
relaton-
|
189
|
-
relaton-
|
190
|
-
relaton-
|
191
|
-
relaton-
|
192
|
-
relaton-
|
193
|
-
relaton-
|
194
|
-
relaton-
|
195
|
-
|
213
|
+
relaton (1.1.0)
|
214
|
+
relaton-calconnect (~> 1.1.0)
|
215
|
+
relaton-gb (~> 1.1.0)
|
216
|
+
relaton-iec (~> 1.1.0)
|
217
|
+
relaton-ieee (~> 1.1.0)
|
218
|
+
relaton-ietf (~> 1.1.0)
|
219
|
+
relaton-iso (~> 1.1.0)
|
220
|
+
relaton-itu (~> 1.1.0)
|
221
|
+
relaton-nist (~> 1.1.0)
|
222
|
+
relaton-ogc (~> 1.1.0)
|
223
|
+
relaton-omg (~> 1.1.0)
|
224
|
+
relaton-un (~> 1.1.0)
|
225
|
+
relaton-w3c (~> 1.1.0)
|
226
|
+
relaton-bib (1.1.0)
|
196
227
|
addressable
|
197
228
|
bibtex-ruby
|
198
229
|
iso639
|
199
230
|
nokogiri
|
200
|
-
relaton-calconnect (
|
231
|
+
relaton-calconnect (1.1.0)
|
201
232
|
faraday
|
202
|
-
relaton-iso-bib (~>
|
203
|
-
relaton-cli (
|
233
|
+
relaton-iso-bib (~> 1.1.0)
|
234
|
+
relaton-cli (1.1.4)
|
204
235
|
liquid
|
205
|
-
relaton (~>
|
236
|
+
relaton (~> 1.1.0)
|
206
237
|
thor
|
207
|
-
relaton-gb (
|
238
|
+
relaton-gb (1.1.0)
|
208
239
|
cnccs (~> 0.1.1)
|
209
240
|
gb-agencies (~> 0.0.1)
|
210
|
-
relaton-iso-bib (
|
211
|
-
relaton-iec (
|
241
|
+
relaton-iso-bib (>= 1.1.0)
|
242
|
+
relaton-iec (1.1.0)
|
212
243
|
addressable
|
213
|
-
relaton-iso-bib (~>
|
214
|
-
relaton-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
relaton
|
221
|
-
relaton-iso
|
244
|
+
relaton-iso-bib (~> 1.1.0)
|
245
|
+
relaton-ieee (1.1.0)
|
246
|
+
faraday (~> 1.0.0)
|
247
|
+
relaton-bib (~> 1.1.0)
|
248
|
+
relaton-ietf (1.1.4)
|
249
|
+
relaton-bib (~> 1.1.0)
|
250
|
+
relaton-iev (1.0.0)
|
251
|
+
relaton (~> 1)
|
252
|
+
relaton-iso (1.1.0)
|
253
|
+
relaton-iec (~> 1.1.0)
|
254
|
+
relaton-iso-bib (~> 1.1.0)
|
255
|
+
relaton-iso-bib (1.1.1)
|
222
256
|
isoics (~> 0.1.6)
|
223
|
-
relaton-bib (~>
|
224
|
-
relaton-itu (
|
225
|
-
relaton-iso-bib (~>
|
226
|
-
relaton-nist (
|
227
|
-
relaton-bib (~>
|
257
|
+
relaton-bib (~> 1.1.0)
|
258
|
+
relaton-itu (1.1.0)
|
259
|
+
relaton-iso-bib (~> 1.1.0)
|
260
|
+
relaton-nist (1.1.0)
|
261
|
+
relaton-bib (~> 1.1.0)
|
228
262
|
rubyzip
|
229
|
-
relaton-ogc (
|
263
|
+
relaton-ogc (1.1.0)
|
230
264
|
faraday (~> 1.0.0)
|
231
|
-
relaton-iso-bib (
|
232
|
-
relaton-omg (
|
233
|
-
relaton-bib (~>
|
234
|
-
relaton-un (
|
265
|
+
relaton-iso-bib (~> 1.1.0)
|
266
|
+
relaton-omg (1.1.0)
|
267
|
+
relaton-bib (~> 1.1.0)
|
268
|
+
relaton-un (1.1.0)
|
235
269
|
faraday
|
236
270
|
http-cookie
|
237
|
-
relaton-bib (~>
|
271
|
+
relaton-iso-bib (~> 1.1.0)
|
238
272
|
unf_ext (>= 0.0.7.7)
|
239
|
-
relaton-w3c (
|
240
|
-
relaton-bib (>=
|
273
|
+
relaton-w3c (1.1.0)
|
274
|
+
relaton-bib (>= 1.1.0)
|
241
275
|
roman-numerals (0.3.0)
|
242
276
|
rspec (3.9.0)
|
243
277
|
rspec-core (~> 3.9.0)
|
@@ -247,9 +281,9 @@ GEM
|
|
247
281
|
mixlib-shellout (~> 2.0)
|
248
282
|
rspec (~> 3.2)
|
249
283
|
rspec-its (~> 1.2)
|
250
|
-
rspec-core (3.9.
|
251
|
-
rspec-support (~> 3.9.
|
252
|
-
rspec-expectations (3.9.
|
284
|
+
rspec-core (3.9.2)
|
285
|
+
rspec-support (~> 3.9.3)
|
286
|
+
rspec-expectations (3.9.2)
|
253
287
|
diff-lcs (>= 1.2.0, < 2.0)
|
254
288
|
rspec-support (~> 3.9.0)
|
255
289
|
rspec-its (1.3.0)
|
@@ -258,23 +292,24 @@ GEM
|
|
258
292
|
rspec-mocks (3.9.1)
|
259
293
|
diff-lcs (>= 1.2.0, < 2.0)
|
260
294
|
rspec-support (~> 3.9.0)
|
261
|
-
rspec-support (3.9.
|
295
|
+
rspec-support (3.9.3)
|
262
296
|
ruby-jing (0.0.1)
|
263
297
|
optout (>= 0.0.2)
|
264
298
|
rubyzip (2.3.0)
|
265
|
-
sassc (2.
|
299
|
+
sassc (2.4.0)
|
266
300
|
ffi (~> 1.9)
|
267
301
|
sterile (1.0.16)
|
268
302
|
nokogiri (>= 1.10.8)
|
269
303
|
thor (0.20.3)
|
270
304
|
thread_safe (0.3.6)
|
305
|
+
tokenizer (0.3.0)
|
271
306
|
twitter_cldr (4.4.5)
|
272
307
|
camertron-eprun
|
273
308
|
cldr-plurals-runtime-rb (~> 1.0)
|
274
309
|
tzinfo
|
275
310
|
tzinfo (2.0.2)
|
276
311
|
concurrent-ruby (~> 1.0)
|
277
|
-
tzinfo-data (1.
|
312
|
+
tzinfo-data (1.2020.1)
|
278
313
|
tzinfo (>= 1.0.0)
|
279
314
|
unf (0.1.4)
|
280
315
|
unf_ext
|
@@ -289,6 +324,7 @@ DEPENDENCIES
|
|
289
324
|
byebug (~> 10.0)
|
290
325
|
equivalent-xml (~> 0.6)
|
291
326
|
metanorma-cli!
|
327
|
+
pry
|
292
328
|
rake (~> 12.0)
|
293
329
|
rspec (~> 3.0)
|
294
330
|
rspec-command (~> 1.0.3)
|
data/a
CHANGED
data/a.json
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
{
|
2
|
+
"id": "<GUID>",
|
3
|
+
"actor": {
|
4
|
+
"name": "<Student Name>",
|
5
|
+
"mbox": "<Student Email Address>",
|
6
|
+
"objectType": "Person"
|
7
|
+
},
|
8
|
+
"verb": {
|
9
|
+
"id": "http://adlnet.gov/expapi/verbs/completed",
|
10
|
+
"display": {
|
11
|
+
"en-US": "completed"
|
12
|
+
}
|
13
|
+
},
|
14
|
+
"object": {
|
15
|
+
"id": "<Activity URL>",
|
16
|
+
"definition": {
|
17
|
+
"name": {
|
18
|
+
"en-US": "<Activity name>"
|
19
|
+
},
|
20
|
+
"description": {
|
21
|
+
"en-US": "<Activity description>"
|
22
|
+
},
|
23
|
+
"type": "http://id.tincanapi.com/activitytype/resource"
|
24
|
+
},
|
25
|
+
"objectType": "Activity"
|
26
|
+
},
|
27
|
+
"result": {
|
28
|
+
"completion": "<Boolean>",
|
29
|
+
"duration": "<Cumulative ISO 8601 Duration>"
|
30
|
+
},
|
31
|
+
"timestamp": "<Start, ISO 8601 DATE>"
|
32
|
+
}
|
33
|
+
|
data/lib/metanorma/cli.rb
CHANGED
@@ -12,15 +12,29 @@ module Metanorma
|
|
12
12
|
"metanorma-gb",
|
13
13
|
"metanorma-csd",
|
14
14
|
"metanorma-csa",
|
15
|
+
"metanorma-iho",
|
15
16
|
"metanorma-m3d",
|
16
17
|
"metanorma-generic",
|
17
18
|
"metanorma-standoc",
|
18
19
|
"metanorma-un",
|
19
20
|
"metanorma-nist",
|
20
21
|
"metanorma-ogc",
|
21
|
-
"metanorma-itu"
|
22
|
+
"metanorma-itu",
|
22
23
|
]
|
23
24
|
|
25
|
+
# @TODO: Note
|
26
|
+
#
|
27
|
+
# This is temporary, we are going to extend this to
|
28
|
+
# each of the metanorma gem, so they can specifcy their
|
29
|
+
# own font requirements.
|
30
|
+
#
|
31
|
+
# Please add the whole set here.
|
32
|
+
#
|
33
|
+
REQUIRED_FONTS = [
|
34
|
+
"CALIBRI.TTF",
|
35
|
+
"CAMBRIA.TTC",
|
36
|
+
].freeze
|
37
|
+
|
24
38
|
PRIVATE_SUPPORTED_GEMS = ["metanorma-rsd", "metanorma-mpfd"]
|
25
39
|
|
26
40
|
def self.load_flavors(flavor_names = SUPPORTED_GEMS + PRIVATE_SUPPORTED_GEMS)
|
@@ -80,6 +94,14 @@ module Metanorma
|
|
80
94
|
Pathname.new(Dir.home).join(".metanorma")
|
81
95
|
end
|
82
96
|
|
97
|
+
def self.fonts_directory
|
98
|
+
Metanorma::Cli.home_directory.join("fonts")
|
99
|
+
end
|
100
|
+
|
101
|
+
def self.fonts
|
102
|
+
Dir.glob(Metanorma::Cli.fonts_directory.join("**"))
|
103
|
+
end
|
104
|
+
|
83
105
|
def self.writable_templates_path?
|
84
106
|
parent_directory = templates_path.join("..", "..")
|
85
107
|
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require "thor"
|
2
|
+
require "metanorma/cli/setup"
|
2
3
|
require "metanorma/cli/compiler"
|
3
4
|
require "metanorma/cli/generator"
|
4
5
|
require "metanorma/cli/git_template"
|
@@ -65,14 +66,32 @@ module Metanorma
|
|
65
66
|
desc "template-repo", "Manage metanorma templates repository"
|
66
67
|
subcommand :template_repo, Metanorma::Cli::Commands::TemplateRepo
|
67
68
|
|
69
|
+
desc "setup", "Initial necessary setup"
|
70
|
+
option(
|
71
|
+
:agree_to_terms,
|
72
|
+
type: :boolean,
|
73
|
+
required: false,
|
74
|
+
default: false,
|
75
|
+
desc: "Agree / Disagree with all third-party licensing terms presented (WARNING: do know what you are agreeing with!)",
|
76
|
+
)
|
77
|
+
|
78
|
+
def setup
|
79
|
+
Metanorma::Cli::REQUIRED_FONTS.each do |font|
|
80
|
+
Metanorma::Cli::Setup.run(
|
81
|
+
font: font,
|
82
|
+
term_agreement: options[:agree_to_terms],
|
83
|
+
)
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
68
87
|
private
|
69
88
|
|
70
89
|
def single_type_extensions(type)
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
90
|
+
return false unless type
|
91
|
+
|
92
|
+
format_keys = find_backend(type).output_formats.keys
|
93
|
+
UI.say("Supported extensions: #{join_keys(format_keys)}.")
|
94
|
+
true
|
76
95
|
end
|
77
96
|
|
78
97
|
def all_type_extensions
|
@@ -0,0 +1,80 @@
|
|
1
|
+
require "fontist"
|
2
|
+
require "fileutils"
|
3
|
+
|
4
|
+
module Metanorma
|
5
|
+
module Cli
|
6
|
+
class Setup
|
7
|
+
def initialize(options)
|
8
|
+
@options = options
|
9
|
+
@font_name = options.fetch(:font)
|
10
|
+
@term_agreement = options.fetch(:term_agreement, false)
|
11
|
+
|
12
|
+
create_metanorma_fonts_directory
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.run(options = {})
|
16
|
+
new(options).run
|
17
|
+
end
|
18
|
+
|
19
|
+
def run
|
20
|
+
font = Metanorma::Cli.fonts.grep(/#{font_name}/i)
|
21
|
+
|
22
|
+
if font.empty?
|
23
|
+
font_paths = download_font
|
24
|
+
copy_to_fonts(font_paths)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
private
|
29
|
+
|
30
|
+
attr_reader :font_name, :options, :term_agreement
|
31
|
+
|
32
|
+
def create_metanorma_fonts_directory
|
33
|
+
unless Metanorma::Cli.fonts_directory.exist?
|
34
|
+
FileUtils.mkdir_p(Metanorma::Cli.fonts_directory)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def metanorma_fonts_path
|
39
|
+
@metanorma_fonts_path ||= Metanorma::Cli.fonts_directory
|
40
|
+
end
|
41
|
+
|
42
|
+
def download_font
|
43
|
+
Fontist::Finder.find(font_name)
|
44
|
+
rescue Fontist::Errors::MissingFontError
|
45
|
+
ask_user_and_download_font(font_name)
|
46
|
+
end
|
47
|
+
|
48
|
+
def copy_to_fonts(fonts_path)
|
49
|
+
fonts_path.each do |font_path|
|
50
|
+
font_name = File.basename(font_path)
|
51
|
+
FileUtils.copy_file(font_path, metanorma_fonts_path.join(font_name))
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
def ask_user_and_download_font(font_name)
|
56
|
+
response = term_agreement ? "yes" : "no"
|
57
|
+
|
58
|
+
if !term_agreement
|
59
|
+
response = UI.ask(message.strip)
|
60
|
+
end
|
61
|
+
|
62
|
+
if response.downcase === "yes"
|
63
|
+
Fontist::Installer.download(font_name, confirmation: response)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
def message
|
68
|
+
<<~MSG
|
69
|
+
Metanorma has detected that you do not have the necessary fonts installed
|
70
|
+
for PDF generation. The generated PDF will use generic fonts that may not
|
71
|
+
resemble the desired styling. Metanorma can download these files for you
|
72
|
+
if you accept the font licensing conditions for the font #{font_name}.
|
73
|
+
|
74
|
+
If you want Metanorma to download these fonts for you and indicate your
|
75
|
+
acceptance of the font licenses, type "Yes" / "No":
|
76
|
+
MSG
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
data/lib/metanorma/cli/ui.rb
CHANGED
data/metanorma-cli.gemspec
CHANGED
@@ -23,6 +23,7 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.require_paths = ["lib"]
|
24
24
|
spec.required_ruby_version = '>= 2.4.0'
|
25
25
|
|
26
|
+
spec.add_development_dependency "pry"
|
26
27
|
spec.add_development_dependency "rake", "~> 12.0"
|
27
28
|
spec.add_development_dependency "rspec", "~> 3.0"
|
28
29
|
spec.add_development_dependency "byebug", "~> 10.0"
|
@@ -37,18 +38,20 @@ Gem::Specification.new do |spec|
|
|
37
38
|
spec.add_runtime_dependency 'metanorma-iec', "~> 1.0.0"
|
38
39
|
spec.add_runtime_dependency 'metanorma-csd', "~> 1.3.0"
|
39
40
|
spec.add_runtime_dependency 'metanorma-csa', "~> 1.4.0"
|
40
|
-
#spec.add_runtime_dependency 'metanorma-rsd', "~> 1.
|
41
|
+
#spec.add_runtime_dependency 'metanorma-rsd', "~> 1.4.0"
|
41
42
|
spec.add_runtime_dependency 'metanorma-m3d', "~> 1.3.0"
|
42
43
|
spec.add_runtime_dependency 'metanorma-generic', "~> 1.4.0"
|
43
|
-
spec.add_runtime_dependency 'metanorma-standoc', "~> 1.
|
44
|
+
spec.add_runtime_dependency 'metanorma-standoc', "~> 1.4.0"
|
44
45
|
#spec.add_runtime_dependency 'metanorma-mpfd', "~> 0.1.0"
|
45
46
|
spec.add_runtime_dependency 'metanorma-un', "~> 0.3.1"
|
46
47
|
spec.add_runtime_dependency 'metanorma-ogc', "~> 1.0.0"
|
47
48
|
spec.add_runtime_dependency 'metanorma-nist', "~> 1.0.0"
|
48
49
|
spec.add_runtime_dependency 'metanorma-itu', "~> 1.0.0"
|
50
|
+
spec.add_runtime_dependency 'metanorma-iho', "~> 0.0.1"
|
49
51
|
spec.add_runtime_dependency 'isodoc', "~> 1.0.0"
|
50
52
|
spec.add_runtime_dependency 'metanorma', "~> 1.0.0"
|
51
53
|
#spec.add_runtime_dependency 'nokogiri', ">= 1"
|
52
54
|
spec.add_runtime_dependency "git", "~> 1.5"
|
53
55
|
spec.add_runtime_dependency "relaton-cli", ">= 0.8.2"
|
56
|
+
spec.add_runtime_dependency "fontist", "~> 0.2.0"
|
54
57
|
end
|
data/test.rxl
CHANGED
@@ -4,7 +4,8 @@
|
|
4
4
|
|
5
5
|
|
6
6
|
<docidentifier type="iso">ISO 123</docidentifier>
|
7
|
-
<docidentifier type="iso-with-lang">ISO 123
|
7
|
+
<docidentifier type="iso-with-lang">ISO 123(E)</docidentifier>
|
8
|
+
<docidentifier type="iso-reference">ISO 123(E)</docidentifier>
|
8
9
|
<docnumber>123</docnumber>
|
9
10
|
<contributor>
|
10
11
|
<role type="author"/>
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.13.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-06-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: pry
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: rake
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -226,20 +240,14 @@ dependencies:
|
|
226
240
|
requirements:
|
227
241
|
- - "~>"
|
228
242
|
- !ruby/object:Gem::Version
|
229
|
-
version: 1.
|
230
|
-
- - ">="
|
231
|
-
- !ruby/object:Gem::Version
|
232
|
-
version: 1.3.18
|
243
|
+
version: 1.4.0
|
233
244
|
type: :runtime
|
234
245
|
prerelease: false
|
235
246
|
version_requirements: !ruby/object:Gem::Requirement
|
236
247
|
requirements:
|
237
248
|
- - "~>"
|
238
249
|
- !ruby/object:Gem::Version
|
239
|
-
version: 1.
|
240
|
-
- - ">="
|
241
|
-
- !ruby/object:Gem::Version
|
242
|
-
version: 1.3.18
|
250
|
+
version: 1.4.0
|
243
251
|
- !ruby/object:Gem::Dependency
|
244
252
|
name: metanorma-un
|
245
253
|
requirement: !ruby/object:Gem::Requirement
|
@@ -296,6 +304,20 @@ dependencies:
|
|
296
304
|
- - "~>"
|
297
305
|
- !ruby/object:Gem::Version
|
298
306
|
version: 1.0.0
|
307
|
+
- !ruby/object:Gem::Dependency
|
308
|
+
name: metanorma-iho
|
309
|
+
requirement: !ruby/object:Gem::Requirement
|
310
|
+
requirements:
|
311
|
+
- - "~>"
|
312
|
+
- !ruby/object:Gem::Version
|
313
|
+
version: 0.0.1
|
314
|
+
type: :runtime
|
315
|
+
prerelease: false
|
316
|
+
version_requirements: !ruby/object:Gem::Requirement
|
317
|
+
requirements:
|
318
|
+
- - "~>"
|
319
|
+
- !ruby/object:Gem::Version
|
320
|
+
version: 0.0.1
|
299
321
|
- !ruby/object:Gem::Dependency
|
300
322
|
name: isodoc
|
301
323
|
requirement: !ruby/object:Gem::Requirement
|
@@ -352,6 +374,20 @@ dependencies:
|
|
352
374
|
- - ">="
|
353
375
|
- !ruby/object:Gem::Version
|
354
376
|
version: 0.8.2
|
377
|
+
- !ruby/object:Gem::Dependency
|
378
|
+
name: fontist
|
379
|
+
requirement: !ruby/object:Gem::Requirement
|
380
|
+
requirements:
|
381
|
+
- - "~>"
|
382
|
+
- !ruby/object:Gem::Version
|
383
|
+
version: 0.2.0
|
384
|
+
type: :runtime
|
385
|
+
prerelease: false
|
386
|
+
version_requirements: !ruby/object:Gem::Requirement
|
387
|
+
requirements:
|
388
|
+
- - "~>"
|
389
|
+
- !ruby/object:Gem::Version
|
390
|
+
version: 0.2.0
|
355
391
|
description: Executable to process any Metanorma standard.
|
356
392
|
email:
|
357
393
|
- open.source@ribose.com
|
@@ -373,6 +409,7 @@ files:
|
|
373
409
|
- README.adoc
|
374
410
|
- Rakefile
|
375
411
|
- a
|
412
|
+
- a.json
|
376
413
|
- a.rb
|
377
414
|
- a.rxl
|
378
415
|
- b
|
@@ -395,6 +432,7 @@ files:
|
|
395
432
|
- lib/metanorma/cli/errors.rb
|
396
433
|
- lib/metanorma/cli/generator.rb
|
397
434
|
- lib/metanorma/cli/git_template.rb
|
435
|
+
- lib/metanorma/cli/setup.rb
|
398
436
|
- lib/metanorma/cli/template_repo.rb
|
399
437
|
- lib/metanorma/cli/ui.rb
|
400
438
|
- lib/metanorma/cli/version.rb
|