metanorma-cli 1.4.3 → 1.4.4pre
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/command.rb +16 -4
- data/lib/metanorma/cli/commands/site.rb +2 -2
- data/lib/metanorma/cli/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f8f43285a5a7526a55de63264f39bd148de4c25a0e50b3dea21b74db266d43b
|
4
|
+
data.tar.gz: 5bfa3a743bc71e911d7e62617e908dfb99108974ee309d6573b327f2c1b44714
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29bd1dcd972cb95ab7c2c29c426fabdd106f1c278f7e4b65dd63e4fc9903cb4f58c95f158b71db5a843a37545ae66f519d81156bb596241830eff9246955f1c9
|
7
|
+
data.tar.gz: dc7d06ff879275e27468f3ebcbbd4f3332f5e9d07745402ab3983f19ec0b125131ce188eb22b9b0dc357fd8ffea739f380201f8005e1c0ed44a325c1b12126b3
|
@@ -39,10 +39,8 @@ module Metanorma
|
|
39
39
|
|
40
40
|
def compile(file_name = nil)
|
41
41
|
if file_name && !options[:version]
|
42
|
-
|
43
|
-
|
44
|
-
errs.each { |e| Util.log e, :error }
|
45
|
-
exit(1) if errs.any?
|
42
|
+
documents = select_wildcard_documents(file_name) || [file_name]
|
43
|
+
documents.each { |document| compile_document(document, options.dup) }
|
46
44
|
|
47
45
|
elsif options[:version]
|
48
46
|
invoke(:version, [], type: options[:type], format: options[:format])
|
@@ -198,6 +196,20 @@ module Metanorma
|
|
198
196
|
|
199
197
|
UI.table(["Type", "Input", "Supported output format"], table_data)
|
200
198
|
end
|
199
|
+
|
200
|
+
def select_wildcard_documents(filename)
|
201
|
+
if filename.include?("*")
|
202
|
+
Dir.glob(Pathname.new(filename))
|
203
|
+
end
|
204
|
+
end
|
205
|
+
|
206
|
+
def compile_document(filename, options)
|
207
|
+
Metanorma::Cli.load_flavors
|
208
|
+
errors = Metanorma::Cli::Compiler.compile(filename, options)
|
209
|
+
errors.each { |error| Util.log(error, :error) }
|
210
|
+
|
211
|
+
exit(1) if errors.any?
|
212
|
+
end
|
201
213
|
end
|
202
214
|
end
|
203
215
|
end
|
@@ -6,7 +6,7 @@ module Metanorma
|
|
6
6
|
module Cli
|
7
7
|
module Commands
|
8
8
|
class Site < ThorWithConfig
|
9
|
-
desc "generate SOURCE_PATH", "Generate site from collection"
|
9
|
+
desc "generate [SOURCE_PATH]", "Generate site from collection"
|
10
10
|
option :config, aliases: "-c", desc: "Metanorma configuration file"
|
11
11
|
option(
|
12
12
|
:output_dir,
|
@@ -19,7 +19,7 @@ module Metanorma
|
|
19
19
|
option :no_install_fonts, type: :boolean, desc: "Skip the font installation process"
|
20
20
|
option :continue_without_fonts, type: :boolean, desc: "Continue processing even when fonts are missing"
|
21
21
|
|
22
|
-
def generate(source_path)
|
22
|
+
def generate(source_path = Dir.pwd)
|
23
23
|
Cli::SiteGenerator.generate(source_path, options, filter_compile_options(options))
|
24
24
|
UI.say("Site has been generated at #{options[:output_dir]}")
|
25
25
|
rescue Cli::Errors::InvalidManifestFileError
|
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.4.
|
4
|
+
version: 1.4.4pre
|
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-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|
@@ -494,11 +494,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
494
494
|
version: 2.4.0
|
495
495
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
496
496
|
requirements:
|
497
|
-
- - "
|
497
|
+
- - ">"
|
498
498
|
- !ruby/object:Gem::Version
|
499
|
-
version:
|
499
|
+
version: 1.3.1
|
500
500
|
requirements: []
|
501
|
-
rubygems_version: 3.
|
501
|
+
rubygems_version: 3.1.4
|
502
502
|
signing_key:
|
503
503
|
specification_version: 4
|
504
504
|
summary: Metanorma is the standard of standards; the metanorma gem allows you to create
|