metanorma-cli 1.6.12 → 1.6.13

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: 697e289ca000fca61cc7d9bffab96ff8f94567e7cd6fa6bd3b375339a086c8c1
4
- data.tar.gz: '0218a133849ae5b7905a8d683ab05a340cb179838ed114f433b1abf7701fac95'
3
+ metadata.gz: 8e981a8cca8c5cae1cda5827f4ff58a1ee6c4b4fd88fe21e690b3d916608ffb8
4
+ data.tar.gz: 2ccc77fef41b7195711de6c9fce1cbf4c4190f84c5f563c87bf3748c8996c873
5
5
  SHA512:
6
- metadata.gz: 46447fd354bbcdef4d56cd13a8f32eff5b242ba29cefbf1f905156358c595b3679c6aa1b2bd9839c4cca6e39b5ebbf4806ee25b5d659c89cef7998ca277a31d1
7
- data.tar.gz: 1afba882aac189cd113eebcd2caa1982d1271f7c69fc24be45ed4808033f10b0dda1916ebe7130ec583eb0b23cd400858976d3899d2e931d9d9f917d9ed4a5fd
6
+ metadata.gz: e376ab6703fda4488ae8ad959422488146da8693256261a6c01e9a45456ddf3401cec1e25eb94fd13bd3a6bfe6c1577d52546cd41c4ea2f78e7d938a66745427
7
+ data.tar.gz: 894e96abc464503da2861917204cb7795db1e3096ff3a0e648d00d135f1c5ceb78cf71c40c4c19d57f7b3429babb463256dcb279382f50b1fc69bab5a96bc8d3
@@ -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".freeze
3
+ VERSION = "1.6.13".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
4
+ version: 1.6.13
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