metanorma-cli 1.9.0 → 1.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/metanorma/cli/errors.rb +18 -0
- data/lib/metanorma/cli/site_generator.rb +6 -1
- data/lib/metanorma/cli/version.rb +1 -1
- data/lib/metanorma/cli.rb +13 -4
- data/metanorma-cli.gemspec +4 -4
- metadata +8 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0a4cc1f8ef67ba443473ca61ec08315026e743c485823ecbcf53d87ff3d1dbd
|
4
|
+
data.tar.gz: f3ce383250bfe93e081c4f62c31563cfa2b7fc73426a9c5914aa078e335a9e00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c280e72d95d709a0200ca6546671bbf4476748089ed4281dfc98cb4d18c83109e38349e7f00d16f9a755612b759059eb208ba52f4d5c61a5500d7c94ccdeb47
|
7
|
+
data.tar.gz: 322b91a1a8940647b5c60b74869aef956f2f31f4d2660c4b6f3d5967e89d626d5a6eb162b2b67b371b3e3db287c8db101ad54b4449d23736e22913906934a147
|
data/lib/metanorma/cli/errors.rb
CHANGED
@@ -5,6 +5,24 @@ module Metanorma
|
|
5
5
|
|
6
6
|
class FileNotFoundError < StandardError; end
|
7
7
|
class InvalidManifestFileError < StandardError; end
|
8
|
+
|
9
|
+
class FatalCompilationError < StandardError
|
10
|
+
attr_reader :fatals
|
11
|
+
|
12
|
+
def initialize(fatals)
|
13
|
+
super()
|
14
|
+
@fatals = fatals
|
15
|
+
end
|
16
|
+
|
17
|
+
def message
|
18
|
+
<<~MSG
|
19
|
+
Fatal compilation error(s):
|
20
|
+
#{fatals.map { |f| "- #{f}" }.join("\n")}
|
21
|
+
|
22
|
+
Look at error.log for more details
|
23
|
+
MSG
|
24
|
+
end
|
25
|
+
end
|
8
26
|
end
|
9
27
|
end
|
10
28
|
end
|
@@ -28,7 +28,12 @@ module Metanorma
|
|
28
28
|
|
29
29
|
def generate
|
30
30
|
site_directory = asset_directory.join("..")
|
31
|
-
|
31
|
+
|
32
|
+
fatals = select_source_files.map { |source| compile(source) }
|
33
|
+
.flatten
|
34
|
+
.compact
|
35
|
+
|
36
|
+
raise Errors::FatalCompilationError, fatals unless fatals.empty?
|
32
37
|
|
33
38
|
Dir.chdir(site_directory) do
|
34
39
|
build_collection_file(collection_name)
|
data/lib/metanorma/cli.rb
CHANGED
@@ -34,9 +34,11 @@ module Metanorma
|
|
34
34
|
Metanorma::Cli::Command.start(arguments)
|
35
35
|
rescue Interrupt, SignalException => _e
|
36
36
|
UI.say("Process cancelled, exiting.")
|
37
|
-
rescue Errors::FileNotFoundError =>
|
38
|
-
UI.say("Error: #{
|
37
|
+
rescue Errors::FileNotFoundError => e
|
38
|
+
UI.say("Error: #{e}. \nNot sure what to run? try: metanorma help")
|
39
39
|
exit(Errno::ENOENT::Errno)
|
40
|
+
rescue Errors::FatalCompilationError => e
|
41
|
+
print_fatal_summary(e)
|
40
42
|
end
|
41
43
|
|
42
44
|
def self.root
|
@@ -72,11 +74,11 @@ module Metanorma
|
|
72
74
|
def self.writable_templates_path?
|
73
75
|
parent_directory = templates_path.join("..", "..")
|
74
76
|
|
75
|
-
unless parent_directory
|
77
|
+
unless parent_directory&.writable?
|
76
78
|
raise Errno::EACCES, "No permission to write in this directory"
|
77
79
|
end
|
78
80
|
|
79
|
-
|
81
|
+
true
|
80
82
|
end
|
81
83
|
|
82
84
|
def self.root_path
|
@@ -91,5 +93,12 @@ module Metanorma
|
|
91
93
|
commands = Metanorma::Cli::Command.all_commands.keys
|
92
94
|
commands.select { |cmd| arguments.include?(cmd.gsub("_", "-")) == true }
|
93
95
|
end
|
96
|
+
|
97
|
+
def self.print_fatal_summary(error)
|
98
|
+
$stdout.flush
|
99
|
+
$stderr.flush
|
100
|
+
UI.error(error.message)
|
101
|
+
exit(-1)
|
102
|
+
end
|
94
103
|
end
|
95
104
|
end
|
data/metanorma-cli.gemspec
CHANGED
@@ -36,9 +36,9 @@ Gem::Specification.new do |spec|
|
|
36
36
|
spec.add_development_dependency "sassc"
|
37
37
|
|
38
38
|
spec.add_runtime_dependency "metanorma-ietf", "~> 3.3.0"
|
39
|
-
spec.add_runtime_dependency "metanorma-iso", "~> 2.7.
|
39
|
+
spec.add_runtime_dependency "metanorma-iso", "~> 2.7.2"
|
40
40
|
spec.add_runtime_dependency "mnconvert"
|
41
|
-
spec.add_runtime_dependency "thor", "~> 1.0"
|
41
|
+
# spec.add_runtime_dependency "thor", "~> 1.0" # inherited from vectory
|
42
42
|
# spec.add_runtime_dependency "metanorma-gb", "~> 1.5.0"
|
43
43
|
spec.add_runtime_dependency "metanorma-cc", "~> 2.4.0"
|
44
44
|
spec.add_runtime_dependency "metanorma-csa", "~> 2.4.0"
|
@@ -46,10 +46,10 @@ Gem::Specification.new do |spec|
|
|
46
46
|
# spec.add_runtime_dependency 'metanorma-ribose', "~> 2.3.0"
|
47
47
|
spec.add_runtime_dependency "metanorma-bipm", "~> 2.4.0"
|
48
48
|
spec.add_runtime_dependency "metanorma-generic", "~> 2.6.0"
|
49
|
-
spec.add_runtime_dependency "metanorma-standoc", "~> 2.8.
|
49
|
+
spec.add_runtime_dependency "metanorma-standoc", "~> 2.8.2"
|
50
50
|
# spec.add_runtime_dependency 'metanorma-mpfa', "~> 0.9.0"
|
51
51
|
spec.add_runtime_dependency "git", "~> 1.5"
|
52
|
-
spec.add_runtime_dependency "metanorma", "~> 1.7.
|
52
|
+
spec.add_runtime_dependency "metanorma", "~> 1.7.1"
|
53
53
|
spec.add_runtime_dependency "metanorma-iho", "~> 0.9.0"
|
54
54
|
spec.add_runtime_dependency "metanorma-itu", "~> 2.4.0"
|
55
55
|
# spec.add_runtime_dependency "metanorma-nist", "~> 2.3.0"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.9.
|
4
|
+
version: 1.9.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: 2024-
|
11
|
+
date: 2024-02-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: debug
|
@@ -170,14 +170,14 @@ dependencies:
|
|
170
170
|
requirements:
|
171
171
|
- - "~>"
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version: 2.7.
|
173
|
+
version: 2.7.2
|
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: 2.7.
|
180
|
+
version: 2.7.2
|
181
181
|
- !ruby/object:Gem::Dependency
|
182
182
|
name: mnconvert
|
183
183
|
requirement: !ruby/object:Gem::Requirement
|
@@ -192,20 +192,6 @@ dependencies:
|
|
192
192
|
- - ">="
|
193
193
|
- !ruby/object:Gem::Version
|
194
194
|
version: '0'
|
195
|
-
- !ruby/object:Gem::Dependency
|
196
|
-
name: thor
|
197
|
-
requirement: !ruby/object:Gem::Requirement
|
198
|
-
requirements:
|
199
|
-
- - "~>"
|
200
|
-
- !ruby/object:Gem::Version
|
201
|
-
version: '1.0'
|
202
|
-
type: :runtime
|
203
|
-
prerelease: false
|
204
|
-
version_requirements: !ruby/object:Gem::Requirement
|
205
|
-
requirements:
|
206
|
-
- - "~>"
|
207
|
-
- !ruby/object:Gem::Version
|
208
|
-
version: '1.0'
|
209
195
|
- !ruby/object:Gem::Dependency
|
210
196
|
name: metanorma-cc
|
211
197
|
requirement: !ruby/object:Gem::Requirement
|
@@ -282,14 +268,14 @@ dependencies:
|
|
282
268
|
requirements:
|
283
269
|
- - "~>"
|
284
270
|
- !ruby/object:Gem::Version
|
285
|
-
version: 2.8.
|
271
|
+
version: 2.8.2
|
286
272
|
type: :runtime
|
287
273
|
prerelease: false
|
288
274
|
version_requirements: !ruby/object:Gem::Requirement
|
289
275
|
requirements:
|
290
276
|
- - "~>"
|
291
277
|
- !ruby/object:Gem::Version
|
292
|
-
version: 2.8.
|
278
|
+
version: 2.8.2
|
293
279
|
- !ruby/object:Gem::Dependency
|
294
280
|
name: git
|
295
281
|
requirement: !ruby/object:Gem::Requirement
|
@@ -310,14 +296,14 @@ dependencies:
|
|
310
296
|
requirements:
|
311
297
|
- - "~>"
|
312
298
|
- !ruby/object:Gem::Version
|
313
|
-
version: 1.7.
|
299
|
+
version: 1.7.1
|
314
300
|
type: :runtime
|
315
301
|
prerelease: false
|
316
302
|
version_requirements: !ruby/object:Gem::Requirement
|
317
303
|
requirements:
|
318
304
|
- - "~>"
|
319
305
|
- !ruby/object:Gem::Version
|
320
|
-
version: 1.7.
|
306
|
+
version: 1.7.1
|
321
307
|
- !ruby/object:Gem::Dependency
|
322
308
|
name: metanorma-iho
|
323
309
|
requirement: !ruby/object:Gem::Requirement
|