trailblazer-activity 0.5.0 → 0.5.1

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: dab847dcaff55b44bfa62dad2a7f8e662458bc082e941dccf1e8f189b87eb6fa
4
- data.tar.gz: f8c1782081b72b024f5fdc06e49d040825979c3cd825cd2a242270fc100d65c3
3
+ metadata.gz: 92e2284135d0c4f569c3b6de38647a5f4dfae359b90a6461539d67fe2a8d58fc
4
+ data.tar.gz: d71820d9da38a2099713bb5fd5005b4680f01c1181e4f6bb919cd84a4ec80443
5
5
  SHA512:
6
- metadata.gz: acd50922b312667f892d6b73d0c39fdb5cfc136f5421af01fdbb0383e065845e332518b02d068a3279b72cc5cbec1e2f6d22c0a9cbaf77abe25af8669b31a0f9
7
- data.tar.gz: e493008be86cff07f981fb6ab6542b14749f17dc91c542bde511f7cfabe14b8b8b0c1eb91dccc6b714a24d66567846b03fe2dbc6898bd598b48b0dd2d16c5192
6
+ metadata.gz: c13c41f9631224f688190808efea928dda6b6cfac0d9fa7c53edc0e77d998b3d9b27ff0f9753394f0403dc2cb0783f2731cfd4b5993cce63ba71518c83006459
7
+ data.tar.gz: 6c2c4ead668c87454a1129254d88cd9a9558336896e7796441f391223ca6e40b5ba4cdb8fae52c4bcc4c0d3fd8a17bfe1f48c1832f88e44a3bfaa0b05e55a21c
data/CHANGES.md CHANGED
@@ -1,3 +1,9 @@
1
+ # 0.5.1
2
+
3
+ * Include all end events without outgoing connections into `Activity.outputs`. In earlier versions, we were filtering out end events without incoming connections, which reduces the number of outputs, but might not represent the desired interface of an activity.
4
+ * Add `_end` to `Railway` and `FastTrack`.
5
+ * Move `Builder::FastTrack::PassFast` and `:::FailFast` to `Activity::FastTrack` since those are signals and unrelated to builders.
6
+
1
7
  # 0.5.0
2
8
 
3
9
  * Rename `Nested()` to `Subprocess` and move the original one to the `operation` gem.
@@ -41,8 +41,8 @@ module Trailblazer
41
41
 
42
42
  # add fast track outputs if :fast_track
43
43
  plus_poles = plus_poles.reverse_merge(
44
- Activity.Output(FailFast, :fail_fast) => :fail_fast,
45
- Activity.Output(PassFast, :pass_fast) => :pass_fast
44
+ Activity.Output(Activity::FastTrack::FailFast, :fail_fast) => :fail_fast,
45
+ Activity.Output(Activity::FastTrack::PassFast, :pass_fast) => :pass_fast
46
46
  ) if options[:fast_track]
47
47
 
48
48
  [
@@ -55,7 +55,7 @@ module Trailblazer
55
55
  class FailPolarization < Railway::StepPolarization
56
56
  def call(magnetic_to, plus_poles, options)
57
57
  plus_poles = plus_poles.reconnect( :failure => :fail_fast, :success => :fail_fast ) if options[:fail_fast]
58
- plus_poles = plus_poles.reverse_merge( Activity.Output(FailFast, :fail_fast) => :fail_fast, Activity.Output(PassFast, :pass_fast) => :pass_fast ) if options[:fast_track]
58
+ plus_poles = plus_poles.reverse_merge( Activity.Output(Activity::FastTrack::FailFast, :fail_fast) => :fail_fast, Activity.Output(Activity::FastTrack::PassFast, :pass_fast) => :pass_fast ) if options[:fast_track]
59
59
 
60
60
  [
61
61
  magnetic_to,
@@ -67,7 +67,7 @@ module Trailblazer
67
67
  class PassPolarization < Railway::StepPolarization
68
68
  def call(magnetic_to, plus_poles, options)
69
69
  plus_poles = plus_poles.reconnect( :success => :pass_fast, :failure => :pass_fast ) if options[:pass_fast]
70
- plus_poles = plus_poles.reverse_merge( Activity.Output(FailFast, :fail_fast) => :fail_fast, Activity.Output(PassFast, :pass_fast) => :pass_fast ) if options[:fast_track]
70
+ plus_poles = plus_poles.reverse_merge( Activity.Output(Activity::FastTrack::FailFast, :fail_fast) => :fail_fast, Activity.Output(Activity::FastTrack::PassFast, :pass_fast) => :pass_fast ) if options[:fast_track]
71
71
 
72
72
  [
73
73
  magnetic_to,
@@ -112,10 +112,6 @@ module Trailblazer
112
112
 
113
113
  path_adds + ends
114
114
  end
115
-
116
- # Direction signals.
117
- FailFast = Class.new(Activity::Signal)
118
- PassFast = Class.new(Activity::Signal)
119
115
  end
120
116
  end
121
117
  end
@@ -37,14 +37,10 @@ module Trailblazer
37
37
  return Circuit.new(circuit_hash, end_events), end_events
38
38
  end
39
39
 
40
- # Filters out unconnected ends, e.g. the standard end in nested tracks that weren't used.
40
+ # Find all end events that don't have outgoing connections.
41
41
  def self.end_events_for(circuit_hash)
42
- tasks_with_incoming_edge = circuit_hash.values.collect { |connections| connections.values }.flatten(1)
43
-
44
42
  ary = circuit_hash.collect do |task, connections|
45
- task.kind_of?(Activity::End) &&
46
- connections.empty? &&
47
- tasks_with_incoming_edge.include?(task) ? task : nil
43
+ task.kind_of?(Activity::End) && connections.empty? ? task : nil
48
44
  end
49
45
 
50
46
  ary.compact
@@ -11,9 +11,14 @@ class Trailblazer::Activity < Module
11
11
  extend: [
12
12
  DSL.def_dsl(:step, Magnetic::Builder::FastTrack, :StepPolarizations),
13
13
  DSL.def_dsl(:fail, Magnetic::Builder::FastTrack, :FailPolarizations),
14
- DSL.def_dsl(:pass, Magnetic::Builder::FastTrack, :PassPolarizations)
14
+ DSL.def_dsl(:pass, Magnetic::Builder::FastTrack, :PassPolarizations),
15
+ DSL.def_dsl(:_end, Magnetic::Builder::Path, :EndEventPolarizations), # TODO: TEST ME
15
16
  ],
16
17
  )
17
18
  end
19
+
20
+ # Signals
21
+ FailFast = Class.new(Signal)
22
+ PassFast = Class.new(Signal)
18
23
  end
19
24
  end
@@ -13,7 +13,8 @@ module Trailblazer
13
13
  extend: [
14
14
  DSL.def_dsl(:step, Magnetic::Builder::Railway, :StepPolarizations),
15
15
  DSL.def_dsl(:fail, Magnetic::Builder::Railway, :FailPolarizations),
16
- DSL.def_dsl(:pass, Magnetic::Builder::Railway, :PassPolarizations)
16
+ DSL.def_dsl(:pass, Magnetic::Builder::Railway, :PassPolarizations),
17
+ DSL.def_dsl(:_end, Magnetic::Builder::Path, :EndEventPolarizations), # TODO: TEST ME
17
18
  ],
18
19
  )
19
20
  end
@@ -1,5 +1,5 @@
1
1
  module Trailblazer
2
2
  class Activity < Module
3
- VERSION = "0.5.0"
3
+ VERSION = "0.5.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trailblazer-activity
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Sutterer
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-03-01 00:00:00.000000000 Z
11
+ date: 2018-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hirb