easy_flow 0.36.0 → 0.37.0

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: f226cae4c62774a756c63d5577a09d1f39aadba37dd2588412fa82952211e462
4
- data.tar.gz: d36d8b4396e2e59ec80abb15435dd31ba0c324161a9b1658151ba8edfa12a054
3
+ metadata.gz: 738d119d2cab4783784532361d52c24c2b2825066ad8970a4dfa03e8e0e3c405
4
+ data.tar.gz: fc233a4ea07c339f27f62f87b83ad218e771ee19bcee08a1e795cde7d1f18c10
5
5
  SHA512:
6
- metadata.gz: f4f7f79213161fc8ce0f91a74f531c89021e829330ff65923b2741287806a7da938957e2cd498627e17dd0bfcd1f5b11ad384960f7b66171aea6ae13e5f6187d
7
- data.tar.gz: e1ab05d520a10f235bf63cbfd99b283d2547b487a8a813db5565d7d4f9564236fe69f760c6769a514d258313fb7d869cb5045852af3b6212730ff661a1c27a1a
6
+ metadata.gz: 95b62e84987cf90ef6eb7061165cb3a733c0a658c91901d46920bb48fcd6364d9642571b9069be6983e9c5983eaa6a97e3c98c174d34a97f83c9e20182d3b915
7
+ data.tar.gz: a83ed3214d6b9c161b3eaeac4d72f3552ac847f2d4bf7ca30685a3dc0861a299c96b52625398cd582a20d1c0e791e0ff7d30e0f33f83d2e08eb3630f42173169
@@ -52,6 +52,14 @@ module EasyFlow
52
52
  records_a_value?(named) ? declared + CompletedAt.outputs : declared
53
53
  end
54
54
 
55
+ def plain_value_is?(id, output_name)
56
+ named = step(id)
57
+ type = step_type(named)
58
+ return true if type.nil? || type.outputs_for(named).empty?
59
+
60
+ type.outputs.one? && type.outputs.first.name.to_s == output_name.to_s
61
+ end
62
+
55
63
  def values_out_of(id)
56
64
  named = step(id)
57
65
  return [] unless named
@@ -19,14 +19,21 @@ module EasyFlow
19
19
  def self.value_of(input, state, run)
20
20
  return run&.owner_id if input["from_run_owner"]
21
21
 
22
- input["step"].present? ? latest_output(input, state) : input["value"]
22
+ input["step"].present? ? latest_output(input, state, run) : input["value"]
23
23
  end
24
24
  private_class_method :value_of
25
25
 
26
- def self.latest_output(input, state)
26
+ def self.latest_output(input, state, run)
27
27
  latest_visit = state.keys.select { |key| key.split("@").first == input["step"] }.max_by { |key| key.split("@")[1].to_i }
28
+ return if unreported?(input, state[latest_visit], run)
29
+
28
30
  CompletedAt.value_of(state, {}, latest_visit, input["output"])
29
31
  end
30
32
  private_class_method :latest_output
33
+
34
+ def self.unreported?(input, recorded, run)
35
+ run && input["output"].present? && !recorded.is_a?(Hash) && !run.digest.plain_value_is?(input["step"], input["output"])
36
+ end
37
+ private_class_method :unreported?
31
38
  end
32
39
  end
@@ -1,3 +1,3 @@
1
1
  module EasyFlow
2
- VERSION = "0.36.0"
2
+ VERSION = "0.37.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_flow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.36.0
4
+ version: 0.37.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - tylercschneider