fbe 0.44.0 → 0.44.1
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/fbe/pmp.rb +12 -3
- data/lib/fbe.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 402427f9ad7494a0b2986eb8c34263e0c2ad09dd374831eaa30c13c6609e2522
|
|
4
|
+
data.tar.gz: 6815e1fe899316cbaf7bc5eee454076d3cf9ccbee4bfb0006357d8d08e413ff6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5ba173a218ba4fb35a1c6107533db8be655f86492efbd6c47b13315e8f5ac5206e24190593c1d5637fe029408c36da048977c307dabadcbf917deac4c4cab026
|
|
7
|
+
data.tar.gz: 5f143ed59036fe621e267723362dff1ae3fc97c6e46901f97b4cf4dd345c6da4fc8764ddc0c23505c3fe2c532d034de08e93747f53a0d49204e410ef71ce3004
|
data/lib/fbe/pmp.rb
CHANGED
|
@@ -70,7 +70,7 @@ def Fbe.pmp(fb: Fbe.fb, global: $global, options: $options, loog: $loog)
|
|
|
70
70
|
others do |*args2|
|
|
71
71
|
param = args2.first.to_s
|
|
72
72
|
f = Fbe.fb(global:, fb:, options:, loog:).query("(and (eq what 'pmp') (eq area '#{area}'))").each.first
|
|
73
|
-
|
|
73
|
+
result = f&.[](param)&.first
|
|
74
74
|
prop = node.at_xpath("p[name='#{param}']")
|
|
75
75
|
default = nil
|
|
76
76
|
type = nil
|
|
@@ -80,13 +80,22 @@ def Fbe.pmp(fb: Fbe.fb, global: $global, options: $options, loog: $loog)
|
|
|
80
80
|
type = prop.at_xpath('type').text
|
|
81
81
|
memo = prop.at_xpath('memo').text
|
|
82
82
|
default =
|
|
83
|
-
case
|
|
83
|
+
case type
|
|
84
84
|
when 'int' then default.to_i
|
|
85
85
|
when 'float' then default.to_f
|
|
86
|
+
when 'bool' then default == 'true'
|
|
86
87
|
else default
|
|
87
88
|
end
|
|
88
89
|
end
|
|
89
|
-
|
|
90
|
+
result ||= default
|
|
91
|
+
result =
|
|
92
|
+
case type
|
|
93
|
+
when 'int' then result.to_i
|
|
94
|
+
when 'float' then result.to_f
|
|
95
|
+
when 'bool' then result == 'true'
|
|
96
|
+
else result
|
|
97
|
+
end
|
|
98
|
+
pmpv.new(result, default, type, memo)
|
|
90
99
|
end
|
|
91
100
|
end.new
|
|
92
101
|
end
|
data/lib/fbe.rb
CHANGED