stepmod-utils 0.6.4 → 0.6.6

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: dd6272ff4c3c263a1bb31f5dabb58058d933a2fa0ef9c9711d23152f79f3634a
4
- data.tar.gz: cf84426917abec57f8abf4af78f23089bc50eb475103860672a748f9023155bf
3
+ metadata.gz: ca5666242ecf90b13b0f4f8cd6ba9775db3b0c4e7705b39e5dbc89f720bf8c11
4
+ data.tar.gz: de1a6c5636529924f8ae9b4795a24569f5070cf348d1cc0e9b470824238995e9
5
5
  SHA512:
6
- metadata.gz: 6342de4cb0ebb220c0d8f0849796e738e75d9ec2182120471af41e11f6eb65f8c1f1944386ec42e7639ba7f69a915c6e4e25552f119fdfb43e0cb35dc7b022fb
7
- data.tar.gz: e78c8c07b90fe7e27521849235dc3c60e3be12eb2e122eca8c2ea5a06701c764205ac8f346714114cf3b5c9470753ee04abcf2da8f9f52f302e51862c0cfbcb9
6
+ metadata.gz: '0839446db646257c8907814f8e951588da4e6ed5481fde60241edc3db308acf78ef5d69816dc179372ebb404e9f66c799dc81c2a978ac5921432c7880224e21c'
7
+ data.tar.gz: b6a8ab5f2b01db122ca23114ac7146643638c18921d9fc0c89ab8ee5a9a4de1be09df9921861ef4cda598156b324e1bf99d11afda0eace1edfbf8f940a305f76
@@ -37,6 +37,10 @@ def copy_files_to_document(path, stepmod_path, srl_output_docs_dir)
37
37
  file_name = path.basename
38
38
  module_xml_path = path.dirname.join("module.xml")
39
39
  # puts "module_xml_path #{module_xml_path}"
40
+ unless File.exist?(module_xml_path)
41
+ puts "[ERROR] Attempting to copy but does not exist: #{module_xml_path}"
42
+ return
43
+ end
40
44
  module_xml = Nokogiri::XML(IO.read(module_xml_path)).root
41
45
 
42
46
  part_number = module_xml.xpath("//module").first.attr("part")
@@ -40,7 +40,7 @@ module Stepmod
40
40
  end
41
41
 
42
42
  def add_change_edition(change_edition)
43
- @change_editions[change_edition[:version]] = change_edition
43
+ @change_editions[change_edition["version"]] = change_edition
44
44
  end
45
45
 
46
46
  def fetch_change_edition(version)
@@ -5,12 +5,12 @@ module Stepmod
5
5
  attr_reader :additions, :modifications, :deletions, :changes
6
6
 
7
7
  def initialize(options)
8
- @version = options[:version]
9
- @description = options[:description]
10
- self.additions = options[:additions] || []
11
- self.modifications = options[:modifications] || []
12
- self.deletions = options[:deletions] || []
13
- self.changes = options[:changes] || []
8
+ @version = options["version"] || options[:version]
9
+ @description = options["description"] || options[:description]
10
+ self.additions = options["additions"] || options[:additions] || []
11
+ self.modifications = options["modifications"] || options[:modifications] || []
12
+ self.deletions = options["deletions"] || options[:deletions] || []
13
+ self.changes = options["changes"] || options[:changes] || []
14
14
  end
15
15
 
16
16
  def additions=(additions)
@@ -9,7 +9,7 @@ module Stepmod
9
9
 
10
10
  def fetch_or_initialize(version)
11
11
  @collection[version] ||=
12
- Stepmod::Utils::ChangeEdition.new(version: version)
12
+ Stepmod::Utils::ChangeEdition.new("version" => version)
13
13
  end
14
14
 
15
15
  def to_h
@@ -175,11 +175,11 @@ collection)
175
175
  deletion_nodes = schema_changes&.xpath("#{node_type}.deletions") || []
176
176
 
177
177
  {
178
- version: options[:version],
179
- description: options[:description],
180
- additions: extract_modified_objects(addition_nodes),
181
- modifications: extract_modified_objects(modification_nodes),
182
- deletions: extract_modified_objects(deletion_nodes),
178
+ "version" => options[:version],
179
+ "description" => options[:description] || converted_description(schema_changes.xpath("description").first),
180
+ "additions" => extract_modified_objects(addition_nodes),
181
+ "modifications" => extract_modified_objects(modification_nodes),
182
+ "deletions" => extract_modified_objects(deletion_nodes),
183
183
  }
184
184
  end
185
185
  # rubocop:enable Metrics/MethodLength
@@ -188,10 +188,10 @@ collection)
188
188
  nodes.map do |node|
189
189
  node.xpath("modified.object").map do |object|
190
190
  {
191
- type: object.attr("type"),
192
- name: object.attr("name"),
193
- description: converted_description(object.at("description")),
194
- interfaced_items: object.attr("interfaced.items"),
191
+ "type" => object.attr("type"),
192
+ "name" => object.attr("name"),
193
+ "description" => converted_description(object.at("description")),
194
+ "interfaced_items" => object.attr("interfaced.items"),
195
195
  }.compact
196
196
  end
197
197
  end.flatten
@@ -29,17 +29,21 @@ module Stepmod
29
29
  ====
30
30
  image::#{svg_filename}.svg[]
31
31
 
32
- #{image_document.xpath('//img.area').map.with_index(1) { |n, i| schema_reference(n['href'], i) }.join("\n")}
32
+ #{image_document.xpath("//img.area").map.with_index(1) { |n, i| schema_reference(n["href"], i) }.join("\n")}
33
33
  ====
34
34
  SVGMAP
35
35
  end
36
36
 
37
37
  def schema_reference(xml_path, index)
38
- if /#/.match?(xml_path)
38
+ if xml_path.include?("#")
39
39
  _, express_path_part = xml_path.split("#")
40
- "* <<express:#{express_path_part.strip}>>; #{index}"
40
+ return "* <<express:#{express_path_part.strip}>>; #{index}"
41
+ end
42
+
43
+ schema_name = File.basename(xml_path, ".*")
44
+ if schema_name.include?("expg")
45
+ "* <<#{schema_name.strip}>>; #{index}"
41
46
  else
42
- schema_name = File.basename(xml_path, ".*")
43
47
  "* <<express:#{schema_name.strip}>>; #{index}"
44
48
  end
45
49
  end
@@ -1,5 +1,5 @@
1
1
  module Stepmod
2
2
  module Utils
3
- VERSION = "0.6.4".freeze
3
+ VERSION = "0.6.6".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stepmod-utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.4
4
+ version: 0.6.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-05-13 00:00:00.000000000 Z
11
+ date: 2024-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby