stepmod-utils 0.4.12 → 0.4.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 277e199cae63ff4916555e4d208672a1d561809e7abb921eff70e022e781e5c1
4
- data.tar.gz: c4762ca7dc28641cbca3c1eebcc393940963d702acd83ef183ad42bf44fb6944
3
+ metadata.gz: 58a97c3c7381351ce5d0ff391e65f6b5d62ce52f541d51975b53c6e4793b5ae0
4
+ data.tar.gz: dd7d17312e634aaab93688e8f3fdee84e1895c025d74dd0a505fd357ea336756
5
5
  SHA512:
6
- metadata.gz: 8999ccb49cae3922ed4c8ef8cdeece7f80ede6501dfe75219d6e6ba0749013850ccfcd6a0d55ecb479441e3210e5a1064a17cbfff9d0348c273b5e999670ae05
7
- data.tar.gz: '039013eaddf84f1afc779b4311c254ace92513a0652418b1648d8da0dbbdb7cc86cad0efb4ba11670a5d5df4b8b56889e788cc73f4a98098e8b27857e74b9e6b'
6
+ metadata.gz: 896b518262254a61c6e0e6a5df7fe5fd992eef5f9a1fb1f9136ee0753a6dc649c9c1ba07fe192c939cfa51b545a4749ffa2610aa9dc4c609b2f7e9385f917437
7
+ data.tar.gz: 54f31dabc624b11cfe48dde83bd0108c07692c4d3d55ee49a7f70ab518cae6914a9013e99f232d1b0c95e2798627904b3f895dad0ff8b47a48d0cd28ed117f21
@@ -64,7 +64,7 @@ module Stepmod
64
64
  options = {
65
65
  schema_name: schema_name,
66
66
  version: change_node.attr("version"),
67
- description: converted_description(change_node.at("description")),
67
+ description: converted_description(change_node.xpath("description").first),
68
68
  }
69
69
 
70
70
  MODULE_TYPES.each do |type|
@@ -132,9 +132,11 @@ module Stepmod
132
132
 
133
133
  def extract_change_edition(schema_changes, options)
134
134
  type = options[:type] || "schema"
135
- addition_nodes = schema_changes&.xpath("#{type}.additions") || []
136
- modification_nodes = schema_changes&.xpath("#{type}.modifications") || []
137
- deletion_nodes = schema_changes&.xpath("#{type}.deletions") || []
135
+ node_type = type.gsub("_longform", "")
136
+
137
+ addition_nodes = schema_changes&.xpath("#{node_type}.additions") || []
138
+ modification_nodes = schema_changes&.xpath("#{node_type}.modifications") || []
139
+ deletion_nodes = schema_changes&.xpath("#{node_type}.deletions") || []
138
140
 
139
141
  {
140
142
  version: options[:version],
@@ -36,6 +36,7 @@ module Stepmod
36
36
  text = preserve_keychars_within_backticks(text)
37
37
 
38
38
  text = preserve_pipes_within_tables(text, state)
39
+ text = wrap_if_contains_spaces(text, state)
39
40
  preserve_tags(text, state)
40
41
  end
41
42
 
@@ -53,6 +54,12 @@ module Stepmod
53
54
  text.gsub(/\A\n+/, "").gsub(/\n+\z/, "")
54
55
  end
55
56
 
57
+ def wrap_if_contains_spaces(text, state)
58
+ return "(#{text})" if state[:equation] && text.strip.match?(/\s/) && text.match?(/^[A-Za-z ]+$/)
59
+
60
+ text
61
+ end
62
+
56
63
  def remove_inner_newlines(text)
57
64
  text.tr("\n\t", " ").squeeze(" ")
58
65
  end
@@ -1,5 +1,5 @@
1
1
  module Stepmod
2
2
  module Utils
3
- VERSION = "0.4.12".freeze
3
+ VERSION = "0.4.13".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.4.12
4
+ version: 0.4.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: 2024-01-02 00:00:00.000000000 Z
11
+ date: 2024-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby