stepmod-utils 0.6.3 → 0.6.4

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: 10c93752f86abb0c914b9041affef80fdedec72e4ccac9a53b382735013230cb
4
- data.tar.gz: 94f588ae4c287ac44910212b00c298542855999eea610e9e84274f338d825fc8
3
+ metadata.gz: dd6272ff4c3c263a1bb31f5dabb58058d933a2fa0ef9c9711d23152f79f3634a
4
+ data.tar.gz: cf84426917abec57f8abf4af78f23089bc50eb475103860672a748f9023155bf
5
5
  SHA512:
6
- metadata.gz: b59490db126c0b56b96cb295a68d9e226049a85006083d141580e10545db0ae56e93250a069cc607485ddc46c47d466e6da4af7295d3d27fce4a63bbd94a4370
7
- data.tar.gz: b04a75dfdcfd88c9a20be4a499c7785990efbc6c91632f5635cbbe79b4c8582d1c6e6681a34b189d00255f0d32013a7fe9fcdb37cfbc71155ee2da3e0c575275
6
+ metadata.gz: 6342de4cb0ebb220c0d8f0849796e738e75d9ec2182120471af41e11f6eb65f8c1f1944386ec42e7639ba7f69a915c6e4e25552f119fdfb43e0cb35dc7b022fb
7
+ data.tar.gz: e78c8c07b90fe7e27521849235dc3c60e3be12eb2e122eca8c2ea5a06701c764205ac8f346714114cf3b5c9470753ee04abcf2da8f9f52f302e51862c0cfbcb9
@@ -43,7 +43,7 @@ module Stepmod
43
43
  end
44
44
  end
45
45
 
46
- SCHEMA_VERSION_MATCH_REGEX = /^SCHEMA [0-9a-zA-Z_]+;\s*$/
46
+ SCHEMA_VERSION_MATCH_REGEX = /^[[:space:]]*?SCHEMA [0-9a-zA-Z_]+;(?<trailing>.*)[[:space:]]*$/
47
47
  def is_missing_version(schema_content)
48
48
  m = schema_content.match(SCHEMA_VERSION_MATCH_REGEX)
49
49
  if m.nil?
@@ -55,6 +55,16 @@ module Stepmod
55
55
  end
56
56
  end
57
57
 
58
+ def replace_schema_string_with_version(content)
59
+ m = content.match(SCHEMA_VERSION_MATCH_REGEX)
60
+ result = build_schema_string_with_version
61
+ unless m['trailing'].nil?
62
+ result = "#{result}#{m['trailing']}"
63
+ end
64
+
65
+ content.gsub!(SCHEMA_VERSION_MATCH_REGEX, result)
66
+ end
67
+
58
68
  def build_schema_string_with_version
59
69
  # Geometric_tolerance_arm => geometric-tolarance-arm
60
70
  name_in_asn1 = @schema_name.downcase.gsub("_", "-")
@@ -80,7 +90,7 @@ module Stepmod
80
90
  edition = @identifier.edition
81
91
  schema_or_object = (schema_type == :module) ? "schema" : "object"
82
92
 
83
- "SCHEMA #{@schema_name} '{ " \
93
+ "\nSCHEMA #{@schema_name} '{ " \
84
94
  "iso standard 10303 part(#{part}) " \
85
95
  "version(#{edition}) " \
86
96
  "#{schema_or_object}(1) " \
@@ -186,10 +196,7 @@ module Stepmod
186
196
  puts "[annotator-WARNING] schema (#{@schema_name}) missing version string. "\
187
197
  "Adding: `#{build_schema_string_with_version}` to schema."
188
198
 
189
- output_express.gsub!(
190
- SCHEMA_VERSION_MATCH_REGEX,
191
- build_schema_string_with_version
192
- )
199
+ output_express = replace_schema_string_with_version(output_express)
193
200
  end
194
201
 
195
202
  {
@@ -1,5 +1,5 @@
1
1
  module Stepmod
2
2
  module Utils
3
- VERSION = "0.6.3".freeze
3
+ VERSION = "0.6.4".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.3
4
+ version: 0.6.4
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-02 00:00:00.000000000 Z
11
+ date: 2024-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby