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 +4 -4
- data/exe/stepmod-srl-migrate +4 -0
- data/lib/stepmod/utils/change.rb +1 -1
- data/lib/stepmod/utils/change_edition.rb +6 -6
- data/lib/stepmod/utils/change_edition_collection.rb +1 -1
- data/lib/stepmod/utils/changes_extractor.rb +9 -9
- data/lib/stepmod/utils/converters/express_g.rb +8 -4
- data/lib/stepmod/utils/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca5666242ecf90b13b0f4f8cd6ba9775db3b0c4e7705b39e5dbc89f720bf8c11
|
4
|
+
data.tar.gz: de1a6c5636529924f8ae9b4795a24569f5070cf348d1cc0e9b470824238995e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0839446db646257c8907814f8e951588da4e6ed5481fde60241edc3db308acf78ef5d69816dc179372ebb404e9f66c799dc81c2a978ac5921432c7880224e21c'
|
7
|
+
data.tar.gz: b6a8ab5f2b01db122ca23114ac7146643638c18921d9fc0c89ab8ee5a9a4de1be09df9921861ef4cda598156b324e1bf99d11afda0eace1edfbf8f940a305f76
|
data/exe/stepmod-srl-migrate
CHANGED
@@ -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")
|
data/lib/stepmod/utils/change.rb
CHANGED
@@ -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)
|
@@ -175,11 +175,11 @@ collection)
|
|
175
175
|
deletion_nodes = schema_changes&.xpath("#{node_type}.deletions") || []
|
176
176
|
|
177
177
|
{
|
178
|
-
version
|
179
|
-
description
|
180
|
-
additions
|
181
|
-
modifications
|
182
|
-
deletions
|
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
|
192
|
-
name
|
193
|
-
description
|
194
|
-
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(
|
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
|
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
|
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
|
+
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-
|
11
|
+
date: 2024-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|