stepmod-utils 0.6.4 → 0.6.5

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: 17f10378d866d0d9f21341181a3c49fd9fc20c791acc86043bed786df886d9c7
4
+ data.tar.gz: 10bc583e2f40b9331cf6eb2f17d762ed1e4c99286f03764c8678b5160d35a00d
5
5
  SHA512:
6
- metadata.gz: 6342de4cb0ebb220c0d8f0849796e738e75d9ec2182120471af41e11f6eb65f8c1f1944386ec42e7639ba7f69a915c6e4e25552f119fdfb43e0cb35dc7b022fb
7
- data.tar.gz: e78c8c07b90fe7e27521849235dc3c60e3be12eb2e122eca8c2ea5a06701c764205ac8f346714114cf3b5c9470753ee04abcf2da8f9f52f302e51862c0cfbcb9
6
+ metadata.gz: 40e340a93b7f95d56c3c1754ee1725dc0267c6a62d9a1f5838c39fd22ddc9e834e1d4a6c41c1598f791aaf50cbb03c265f1031650f61a1ba21b01ae6a728d3b5
7
+ data.tar.gz: f3f564dea2531731ebeea9c1dbe23e9b8597fe6400efa70b17888ff771edea063c35d5de94c4eedf8fe6968b8ed1f52d564b15b4f0b1e1900d270695ed8e43bb
@@ -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")
@@ -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.5".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.5
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-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby