metanorma-cli 1.6.11 → 1.6.12.pre.pre

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4ff6c55da26f20a34805cad6152939abd3f514603732738fc8afe9fbd9d1b9cc
4
- data.tar.gz: fa801b8a8f9dbdc408c6b006cc34a76216eca07204bd6d7c228d34a91da5c7a1
3
+ metadata.gz: 8de4185bd9e1cad56241808c5a9a648e4622789e9882dc2161e1f48857787c18
4
+ data.tar.gz: 812694ed573cda8595265d14744ebda81cdbacecba9875efe5352a590d4828cc
5
5
  SHA512:
6
- metadata.gz: f37beb19a8d0fa396c21a44606468d215b67b5e75d3e4df76919770a3068d1ed008350a5bd511ffb3128c171f8351d789e21f858c9614a32e4ccf56d4c23d3ac
7
- data.tar.gz: 5f0322db86a08b71c2ce5b5895649e8eed557a1f67fe6dff0dbecf8e846127afea88709624547351cb9787716378aa89c403a16256190ca729ac9741a39bb55c
6
+ metadata.gz: 44308a7617185522ed48275cab56cfa9a2cb45c0754fdeb0d1c37813c3159cda7009336471736c684086a280d6e0338d9a10f195dbdcf20b14cee73b3f23c246
7
+ data.tar.gz: cd12a40f221292e3367ee79fe1ab71161d8558b310091cf2e6f32ffe0d05c8fcfda844ff19f964869b7747166548bf67145363bc5eac48bc9877832ad85e3a8e
@@ -36,6 +36,7 @@ module Metanorma
36
36
  option :extract, aliases: "-e", desc: "Export sourcecode fragments from this document to nominated directory"
37
37
  option :version, aliases: "-v", desc: "Print version of code (accompanied with -t)"
38
38
  option :output_dir, aliases: "-o", desc: "Directory to save compiled files"
39
+ option :strict, aliases: "-S", type: :boolean, desc: "Strict compilation: abort if there are any errors"
39
40
  option :agree_to_terms, type: :boolean, desc: "Agree / Disagree with all third-party licensing terms "\
40
41
  "presented (WARNING: do know what you are agreeing with!)"
41
42
  option :no_install_fonts, type: :boolean, desc: "Skip the font installation process"
@@ -65,6 +66,8 @@ module Metanorma
65
66
  "presented (WARNING: do know what you are agreeing with!)"
66
67
  option :no_install_fonts, type: :boolean, desc: "Skip the font installation process"
67
68
  option :continue_without_fonts, type: :boolean, desc: "Continue processing even when fonts are missing"
69
+ option :strict, aliases: "-S", type: :boolean, \
70
+ desc: "Strict compilation: abort if there are any errors"
68
71
 
69
72
  def collection(filename = nil)
70
73
  if filename
@@ -12,7 +12,7 @@ module Metanorma
12
12
  :output_dir,
13
13
  aliases: "-o",
14
14
  default: Pathname.new(Dir.pwd).join("site").to_s,
15
- desc: "Output directory for generated site"
15
+ desc: "Output directory for generated site",
16
16
  )
17
17
  option :agree_to_terms, type: :boolean, desc: "Agree / Disagree with all third-party licensing terms "\
18
18
  "presented (WARNING: do know what you are agreeing with!)"
@@ -20,9 +20,19 @@ module Metanorma
20
20
  option :continue_without_fonts, type: :boolean, desc: "Continue processing even when fonts are missing"
21
21
  option :stylesheet, alias: "-s", desc: "Stylesheet file path for rendering HTML page"
22
22
  option :template_dir, alias: "-t", desc: "Liquid template directory to render site design"
23
+ option(
24
+ :strict,
25
+ aliases: "-S",
26
+ type: :boolean,
27
+ desc: "Strict compilation: abort if there are any errors",
28
+ )
23
29
 
24
30
  def generate(source_path = Dir.pwd)
25
- Cli::SiteGenerator.generate(source_path, options, filter_compile_options(options))
31
+ Cli::SiteGenerator.generate(
32
+ source_path,
33
+ options,
34
+ filter_compile_options(options),
35
+ )
26
36
  UI.say("Site has been generated at #{options[:output_dir]}")
27
37
  rescue Cli::Errors::InvalidManifestFileError
28
38
  UI.error("Invalid data in: #{options[:config]}")
@@ -1,8 +1,6 @@
1
1
  require "thor"
2
2
  require "metanorma-utils"
3
3
 
4
- #require_relative "stringify_all_keys"
5
-
6
4
  module Metanorma
7
5
  module Cli
8
6
  class ThorWithConfig < Thor
@@ -13,14 +11,19 @@ module Metanorma
13
11
  def options
14
12
  original_options = super.to_hash.symbolize_all_keys
15
13
  Thor::CoreExt::HashWithIndifferentAccess.new(
16
- Metanorma::Cli::Commands::Config.load_configs(original_options)
14
+ Metanorma::Cli::Commands::Config.load_configs(original_options),
17
15
  )
18
16
  end
19
17
 
20
18
  def filter_compile_options(options)
21
- options.select do |k, _|
22
- %w[agree_to_terms no_install_fonts continue_without_fonts no_progress].include?(k)
23
- end.symbolize_all_keys
19
+ copts = %w[
20
+ agree_to_terms
21
+ no_install_fonts
22
+ continue_without_fonts
23
+ no_progress
24
+ strict
25
+ ]
26
+ options.select { |k, _| copts.include?(k) }.symbolize_all_keys
24
27
  end
25
28
  end
26
29
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Cli
3
- VERSION = "1.6.11".freeze
3
+ VERSION = "1.6.12-pre".freeze
4
4
  end
5
5
  end
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.6.11
4
+ version: 1.6.12.pre.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-12-30 00:00:00.000000000 Z
11
+ date: 2023-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: debug
@@ -506,9 +506,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
506
506
  version: 2.7.0
507
507
  required_rubygems_version: !ruby/object:Gem::Requirement
508
508
  requirements:
509
- - - ">="
509
+ - - ">"
510
510
  - !ruby/object:Gem::Version
511
- version: '0'
511
+ version: 1.3.1
512
512
  requirements: []
513
513
  rubygems_version: 3.3.26
514
514
  signing_key: