metanorma-cli 1.6.12.pre.pre → 1.6.13.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: 8de4185bd9e1cad56241808c5a9a648e4622789e9882dc2161e1f48857787c18
4
- data.tar.gz: 812694ed573cda8595265d14744ebda81cdbacecba9875efe5352a590d4828cc
3
+ metadata.gz: 71c6f33aa5986a4fa3b5054ff98deb8b1ba11eb862a4cf258235091abe717607
4
+ data.tar.gz: b7540dc077134eeeb8cd470bb74ddda591de4caf985a5681d38815ded0e71465
5
5
  SHA512:
6
- metadata.gz: 44308a7617185522ed48275cab56cfa9a2cb45c0754fdeb0d1c37813c3159cda7009336471736c684086a280d6e0338d9a10f195dbdcf20b14cee73b3f23c246
7
- data.tar.gz: cd12a40f221292e3367ee79fe1ab71161d8558b310091cf2e6f32ffe0d05c8fcfda844ff19f964869b7747166548bf67145363bc5eac48bc9877832ad85e3a8e
6
+ metadata.gz: a3ce83fc8b69e758e233e9cf9a8eac7aa017abf700fe04138860599c9c1778d65df8e830175fc09211dc86c679cc82830383d57de42d2acb207d5287ea432a7c
7
+ data.tar.gz: 8272ad07ae94ee6509c3c8d850a2972e954c1e41941798f6b8c0d8ea293c248b14a940db723acfa075651adfa557c391e349bb08c2d82d1139e7e3f5397b5575
@@ -16,7 +16,7 @@ module Metanorma
16
16
  def get(name = nil)
17
17
  config, config_path = load_config(options[:global], create_default_config: false)
18
18
 
19
- if name.nil? && File.exists?(config_path)
19
+ if name.nil? && File.exist?(config_path)
20
20
  UI.say File.read(config_path, encoding: "utf-8")
21
21
  else
22
22
  UI.say(config.dig(*dig_path(name)) || "nil")
@@ -54,7 +54,7 @@ module Metanorma
54
54
  def self.load_configs(options, configs = [Metanorma::Cli.global_config_path, Metanorma::Cli.local_config_path])
55
55
  result = options.dup
56
56
  configs.each do |config_path|
57
- next unless File.exists?(config_path)
57
+ next unless File.exist?(config_path)
58
58
 
59
59
  config_values = ::YAML::load_file(config_path).symbolize_all_keys[:cli] || {}
60
60
  result.merge!(config_values)
@@ -82,7 +82,7 @@ module Metanorma
82
82
  def load_config(global_config, create_default_config: true)
83
83
  config_path = Metanorma::Cli.config_path(global_config)
84
84
 
85
- unless File.exists?(config_path) || create_default_config
85
+ unless File.exist?(config_path) || create_default_config
86
86
  config_path = Metanorma::Cli.config_path(true)
87
87
  end
88
88
 
@@ -6,12 +6,14 @@ module Metanorma
6
6
  module Cli
7
7
  module Commands
8
8
  class Site < ThorWithConfig
9
+ SITE_OUTPUT_DIRNAME = "_site".freeze
10
+
9
11
  desc "generate [SOURCE_PATH]", "Generate site from collection"
10
12
  option :config, aliases: "-c", desc: "Metanorma configuration file"
11
13
  option(
12
14
  :output_dir,
13
15
  aliases: "-o",
14
- default: Pathname.new(Dir.pwd).join("site").to_s,
16
+ default: Pathname.new(Dir.pwd).join(SITE_OUTPUT_DIRNAME).to_s,
15
17
  desc: "Output directory for generated site",
16
18
  )
17
19
  option :agree_to_terms, type: :boolean, desc: "Agree / Disagree with all third-party licensing terms "\
@@ -129,7 +129,6 @@ module Metanorma
129
129
  end
130
130
 
131
131
  def create_file(source, destination)
132
- p "source=#{source} destination=#{destination}"
133
132
  target_path = [document_path, destination].join("/")
134
133
  target_path = Pathname.new(target_path)
135
134
 
@@ -8,7 +8,9 @@ module Metanorma
8
8
  def initialize(source, options = {}, compile_options = {})
9
9
  @collection_queue = []
10
10
  @source = find_realpath(source)
11
- @site_path = options.fetch(:output_dir, "site").to_s
11
+ @site_path = options.fetch(
12
+ :output_dir, Commands::Site::SITE_OUTPUT_DIRNAME
13
+ ).to_s
12
14
  @asset_folder = options.fetch(:asset_folder, "documents").to_s
13
15
  @collection_name = options.fetch(:collection_name, "documents.xml")
14
16
 
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Cli
3
- VERSION = "1.6.12-pre".freeze
3
+ VERSION = "1.6.13-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.12.pre.pre
4
+ version: 1.6.13.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: 2023-01-24 00:00:00.000000000 Z
11
+ date: 2023-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: debug