mbt-gen 0.0.5 → 0.0.7
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 +4 -4
- data/lib/mbt-gen.rb +23 -2
- 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: 60f33b703c44710c8f3fd4ac743eda550f72af721e6480beb9c62d4e7d1258c7
|
|
4
|
+
data.tar.gz: 53f6012841f8572350c02cffa8fb841ae7de411985c15c21f7c7e02465e191f5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9143a6315fa8e359420862a2e0d8d6dbaf08efb2ae9f749d3f51a178f55ffc619602d098dba6e518cfb606a92fb5f730d2fb627216320817d37aa38a2dc706fd
|
|
7
|
+
data.tar.gz: 292e6fa9e9dc391c906b6d3ee305edc8c7c8a74b39e345380813014177c4d7c68753dfe46eb37ce64ff6ec8aa24f8da261ab97f797d44430fe72aa0ba363934d
|
data/lib/mbt-gen.rb
CHANGED
|
@@ -455,6 +455,12 @@ def resolve_field_path(path, relative_to_struct, prefix)
|
|
|
455
455
|
if prefix
|
|
456
456
|
result = "#{prefix}/#{result}"
|
|
457
457
|
end
|
|
458
|
+
elsif field_def[:type] == :objlist then
|
|
459
|
+
current = nil
|
|
460
|
+
result = segment
|
|
461
|
+
if prefix
|
|
462
|
+
result = "#{prefix}/#{result}"
|
|
463
|
+
end
|
|
458
464
|
end
|
|
459
465
|
end
|
|
460
466
|
return result
|
|
@@ -590,6 +596,15 @@ def translate_validation_rule_to_SMTLIB(rule, context_struct, prefix, config, op
|
|
|
590
596
|
field = resolve_field_path($1, context_struct, prefix)
|
|
591
597
|
filled_var_for_field(field)
|
|
592
598
|
end
|
|
599
|
+
.gsub(/LIST_VALUE\[[^\]]*,[^\]]*\]/) do |m|
|
|
600
|
+
unless m =~ /LIST_VALUE\[([^\]]*),([^\]]*)\]/ then
|
|
601
|
+
raise RuntimeError.new("could not parse LIST_VALUE_FIRST_ELEMENT[...]: #{m.inspect} in validation rule #{rule_name}")
|
|
602
|
+
end
|
|
603
|
+
xpath = $1
|
|
604
|
+
index = Integer($2)
|
|
605
|
+
l = resolve_field_path(xpath, context_struct, prefix)
|
|
606
|
+
value_var_for_list(l, index)
|
|
607
|
+
end
|
|
593
608
|
.gsub(/VALUE\[[^\]]*\]/) do |m|
|
|
594
609
|
unless m =~ /VALUE\[([^\]]*)\]/ then
|
|
595
610
|
raise RuntimeError.new("could not parse VALUE[...]: #{m.inspect} in validation rule #{rule_name}")
|
|
@@ -624,7 +639,7 @@ def translate_validation_rule_to_SMTLIB(rule, context_struct, prefix, config, op
|
|
|
624
639
|
end
|
|
625
640
|
"(or #{terms.join(" ")})"
|
|
626
641
|
end
|
|
627
|
-
.gsub(/LIST_VALUE_FIRST_ELEMENT\[[^\]]*\]/) do |m|
|
|
642
|
+
.gsub(/LIST_VALUE_FIRST_ELEMENT\[[^\]]*\]/) do |m| # DEPRECATED! Please use LIST_VALUE[...] instead.
|
|
628
643
|
unless m =~ /LIST_VALUE_FIRST_ELEMENT\[([^\]]*)\]/ then
|
|
629
644
|
raise RuntimeError.new("could not parse LIST_VALUE_FIRST_ELEMENT[...]: #{m.inspect} in validation rule #{rule_name}")
|
|
630
645
|
end
|
|
@@ -1708,7 +1723,13 @@ def validate_model(message, prefix=nil)
|
|
|
1708
1723
|
end
|
|
1709
1724
|
elsif value[:type] == :list then
|
|
1710
1725
|
unless value[:datatype] then
|
|
1711
|
-
raise RuntimeError.new("Model Problem: encountered list without
|
|
1726
|
+
raise RuntimeError.new("Model Problem: encountered list without :datatype property (key=#{key.inspect}, value=#{value.inspect})")
|
|
1727
|
+
end
|
|
1728
|
+
unless value[:model_maxLength] then
|
|
1729
|
+
raise RuntimeError.new("Model Problem: encountered list without :model_maxLength property (key=#{key.inspect}, value=#{value.inspect})")
|
|
1730
|
+
end
|
|
1731
|
+
unless value[:xpath_element] then
|
|
1732
|
+
raise RuntimeError.new("Model Problem: encountered list without :xpath_element property (key=#{key.inspect}, value=#{value.inspect})")
|
|
1712
1733
|
end
|
|
1713
1734
|
if value[:datatype] == :enum then
|
|
1714
1735
|
unless value[:values] then
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mbt-gen
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- FM-enthusiast
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-07-
|
|
11
|
+
date: 2026-07-31 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: nokogiri
|