metanorma-cli 1.7.1 → 1.7.2pre1

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: 02574e7929bebfce46a37180a0953ce5aefd6113fcb5a3d7e5799ca8bbea2030
4
- data.tar.gz: ccc4616c73b9249b440970299a3783ef2cdd5fcb70c332a0a4eb7093e9e93824
3
+ metadata.gz: 9e0fa8d6b6397a49adc58b101f7e5bbfb03cdf396bd92d3aa654b1dc0539d06e
4
+ data.tar.gz: 3d077ee1c315cd283b5e8c63b37dfdae4a4ed284282db32c64456ea7176ca883
5
5
  SHA512:
6
- metadata.gz: '0928c8a1c3bc9eaebb9d13d85ee22506b4e14c492d23959721e4cc7b1dc5a1687546be120c905f2616a195ebd287829aff8ff26398d4a89c714a2f7efaede693'
7
- data.tar.gz: 68c8f106254a8cc16eda790705952e551263af2d528accbec226ad9964fea89f10a7595c38975d38bbbd45b721c5d7bd83066bb6a179a7f4de20edb7d4921535
6
+ metadata.gz: a85d187fbd6b790bfd5eadfb1651b129942aa01eb6eb57afe9ce77cf3cd32e3b03ec8f99db28c4f660bc33262c631657ae6c4c6544c4b6e3f3a919057b965a3c
7
+ data.tar.gz: 75f28745946a12675d6476706afe880b89da0d2e917b9d6706e433a43e5d1b8ddbcbae7e5df9d92a5475995a3f3455fe9a6ea62392cf319ed28dd6aecbe4331a
@@ -59,12 +59,24 @@ module Metanorma
59
59
  end
60
60
 
61
61
  def extract_options_from_file
62
- yaml_file = YAML.safe_load(File.read(@file.to_s))
62
+ yaml_file = if /\.ya?ml$/.match?(@file.to_s)
63
+ YAML.safe_load(File.read(@file.to_s))
64
+ elsif /\.xml$/.match?(@file.to_s)
65
+ xml_extract_options_from_file
66
+ end
63
67
 
64
- @options = Cli.with_indifferent_access(
65
- yaml_file.slice("coverpage", "format", "output_folder"),
66
- )
67
- @options.merge!(options)
68
+ old = options.dup
69
+ @options = Cli.with_indifferent_access(
70
+ yaml_file.slice("coverpage", "format", "output_folder"),
71
+ )
72
+ @options.merge!(old)
73
+ end
74
+
75
+ def xml_extract_options_from_file
76
+ xml = Nokogiri::XML File.read(@file.to_s, encoding: "UTF-8") { |c| c.huge }
77
+ { "coverpage" => xml.at("//xmlns:coverpage"),
78
+ "format" => xml.at("//xmlns:format"),
79
+ "output_folder" => xml.at("//xmlns:output_folder") }.compact
68
80
  end
69
81
  end
70
82
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Cli
3
- VERSION = "1.7.1".freeze
3
+ VERSION = "1.7.2pre1".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.7.1
4
+ version: 1.7.2pre1
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-04-25 00:00:00.000000000 Z
11
+ date: 2023-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: debug
@@ -478,9 +478,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
478
478
  version: 2.7.0
479
479
  required_rubygems_version: !ruby/object:Gem::Requirement
480
480
  requirements:
481
- - - ">="
481
+ - - ">"
482
482
  - !ruby/object:Gem::Version
483
- version: '0'
483
+ version: 1.3.1
484
484
  requirements: []
485
485
  rubygems_version: 3.3.26
486
486
  signing_key: