tasker-rb 0.1.6 → 0.1.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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a8c5ed3385bea52ede9378bb4cd2f35c4fb03e285a0b811698fa34042b2a0c8a
|
|
4
|
+
data.tar.gz: a9ce3c0d4d390ae8f0263ca60794c8a0997d99ca6272c52ccd7a8cea579de6ae
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d7957c47e7f5403a0adc3cbfc917b49196e44e21438276f806809662b0bd3abaa2ff14408e69233dd06e1521fece83cc0f320d3601d152e8ee69730212f3ca58
|
|
7
|
+
data.tar.gz: e7844fe1ee414c7f3887db916b084c15ac44768885516792964bce9afff6cd807a8b847335428cb367fb7e0042730b8bc95a098e89cc7a24851ca0b96bc8b5db
|
data/lib/tasker_core/models.rb
CHANGED
|
@@ -192,8 +192,13 @@ module TaskerCore
|
|
|
192
192
|
#
|
|
193
193
|
# @param results_data [Hash] Hash of step names to their results
|
|
194
194
|
def initialize(results_data)
|
|
195
|
-
# Use HashWithIndifferentAccess for developer-friendly key access
|
|
196
|
-
|
|
195
|
+
# Use HashWithIndifferentAccess for developer-friendly key access.
|
|
196
|
+
# serde_magnus serializes Rust struct field names as Ruby symbols, so
|
|
197
|
+
# each inner StepExecutionResult hash has symbol keys (:result, :success, etc.).
|
|
198
|
+
# Convert them to indifferent access so callers can use string or symbol keys.
|
|
199
|
+
raw = results_data || {}
|
|
200
|
+
@results = raw.transform_values { |v| v.is_a?(Hash) ? v.with_indifferent_access : v }
|
|
201
|
+
.with_indifferent_access
|
|
197
202
|
end
|
|
198
203
|
|
|
199
204
|
# Get result from a parent step (returns full result hash)
|
|
@@ -136,7 +136,9 @@ module TaskerCore
|
|
|
136
136
|
# Convert to plain Hash first — ActiveSupport::HashWithIndifferentAccess
|
|
137
137
|
# stores keys as strings internally even after transform_keys(&:to_sym),
|
|
138
138
|
# which causes Dry::Struct to silently ignore all attributes.
|
|
139
|
-
|
|
139
|
+
# Hash() is a no-op on HWIA (since it IS-A Hash); .to_h produces
|
|
140
|
+
# a true plain Hash so symbol keys actually stick.
|
|
141
|
+
symbolized = raw.to_h.transform_keys(&:to_sym)
|
|
140
142
|
known = model_cls.attribute_names
|
|
141
143
|
model_cls.new(**symbolized.slice(*known))
|
|
142
144
|
else
|
|
@@ -171,9 +171,7 @@ module TaskerCore
|
|
|
171
171
|
|
|
172
172
|
# Extract all callable references
|
|
173
173
|
def all_callables
|
|
174
|
-
|
|
175
|
-
steps.each { |step| callables << step.handler.callable }
|
|
176
|
-
callables
|
|
174
|
+
steps.map { |step| step.handler.callable }
|
|
177
175
|
end
|
|
178
176
|
|
|
179
177
|
# Check if template is valid for registration
|
data/lib/tasker_core/version.rb
CHANGED