trailblazer-activity 0.3.0 → 0.3.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/CHANGES.md +5 -0
- data/lib/trailblazer/activity/magnetic/builder/fast_track.rb +0 -5
- data/lib/trailblazer/activity/magnetic/builder/path.rb +1 -6
- data/lib/trailblazer/activity/magnetic/builder/railway.rb +0 -4
- data/lib/trailblazer/activity/magnetic/builder.rb +14 -10
- data/lib/trailblazer/activity/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 989cc224fca29c0d3150922613537af4a89bab2e
|
|
4
|
+
data.tar.gz: e0937bd45f8804d7f9ad6329256fb7c7140d0523
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7714ebf879a4f1f4fa95ce9b5937e3bfcb5419e1be5e38a244a5ef0e86feaed8d0619cc82e2a84a9e6b615d176896116173502b449d933c5409f9baa4fb06f35
|
|
7
|
+
data.tar.gz: 21708524bbc25844a5b6e3d2209d73ea4224bbbacb6e7784ef4c389208bca12c6366cbe15c4bfcded4c98d8fbcf276beea661f98cf665f95ca59dae002926f39
|
data/CHANGES.md
CHANGED
|
@@ -84,11 +84,6 @@ module Trailblazer
|
|
|
84
84
|
Railway.default_plus_poles(*args)
|
|
85
85
|
end
|
|
86
86
|
|
|
87
|
-
def self.keywords
|
|
88
|
-
[:fail_fast, :pass_fast, :fast_track, :type, :override]
|
|
89
|
-
end
|
|
90
|
-
|
|
91
|
-
|
|
92
87
|
# Adds the End.fail_fast and End.pass_fast end to the Railway sequence.
|
|
93
88
|
def self.InitialAdds(pass_fast_end: Activity.End("pass_fast", :pass_fast), fail_fast_end: Activity.End("fail_fast", :fail_fast), **builder_options)
|
|
94
89
|
path_adds = Railway.InitialAdds(**builder_options)
|
|
@@ -18,13 +18,8 @@ module Trailblazer
|
|
|
18
18
|
plan_for( *Path.for(normalizer, options), &block )
|
|
19
19
|
end
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
def self.keywords
|
|
23
|
-
[:type]
|
|
24
|
-
end
|
|
25
|
-
|
|
26
21
|
def task(task, options={}, &block)
|
|
27
|
-
polarizations = Path.TaskPolarizations( @builder_options.merge(type: options[:type]) ) # DISCUSS: handle :type here? Really?
|
|
22
|
+
polarizations = Path.TaskPolarizations( @builder_options.merge( type: options[:type] ) ) # DISCUSS: handle :type here? Really?
|
|
28
23
|
|
|
29
24
|
insert_element( Path, polarizations, task, options, &block )
|
|
30
25
|
end
|
|
@@ -14,10 +14,6 @@ module Trailblazer
|
|
|
14
14
|
plan_for( *Railway.for(normalizer, options), &block )
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
-
def self.keywords
|
|
18
|
-
[:type]
|
|
19
|
-
end
|
|
20
|
-
|
|
21
17
|
def step(task, options={}, &block)
|
|
22
18
|
insert_element( Railway, Railway.StepPolarizations(@builder_options), task, options, &block )
|
|
23
19
|
end
|
|
@@ -57,12 +57,9 @@ module Trailblazer
|
|
|
57
57
|
|
|
58
58
|
# Internal top-level entry point to add task(s) and connections.
|
|
59
59
|
def insert_element(impl, polarizations, task, options, &block)
|
|
60
|
-
|
|
61
|
-
end
|
|
60
|
+
normalizer = options[:normalizer] || @normalizer # DISCUSS: do this at a deeper point?
|
|
62
61
|
|
|
63
|
-
|
|
64
|
-
def self.generic_keywords
|
|
65
|
-
[ :id, :plus_poles, :magnetic_to, :adds ]
|
|
62
|
+
adds, *returned_options = Builder.adds_for(polarizations, normalizer, task, options, &block)
|
|
66
63
|
end
|
|
67
64
|
|
|
68
65
|
def self.sequence_keywords
|
|
@@ -81,8 +78,8 @@ module Trailblazer
|
|
|
81
78
|
# @return Adds
|
|
82
79
|
# High level interface for DSL calls like ::task or ::step.
|
|
83
80
|
# TODO: RETURN ALL OPTIONS
|
|
84
|
-
def self.adds_for(polarizations, normalizer,
|
|
85
|
-
task, local_options, options, sequence_options = normalize_options(normalizer,
|
|
81
|
+
def self.adds_for(polarizations, normalizer, task, options, &block)
|
|
82
|
+
task, local_options, options, sequence_options = normalize_options(normalizer, task, options)
|
|
86
83
|
|
|
87
84
|
initial_plus_poles = local_options[:plus_poles]
|
|
88
85
|
magnetic_to = local_options[:magnetic_to]
|
|
@@ -97,16 +94,23 @@ module Trailblazer
|
|
|
97
94
|
end
|
|
98
95
|
|
|
99
96
|
# @private
|
|
100
|
-
def self.normalize_options(normalizer,
|
|
97
|
+
def self.normalize_options(normalizer, task, options)
|
|
98
|
+
keywords = extract_dsl_keywords(options)
|
|
99
|
+
|
|
101
100
|
# sort through the "original" user DSL options.
|
|
102
|
-
options, local_options
|
|
103
|
-
|
|
101
|
+
options, local_options = normalize( options, keywords ) # DISCUSS:
|
|
102
|
+
local_options, sequence_options = normalize( local_options, sequence_keywords )
|
|
104
103
|
|
|
105
104
|
task, local_options, options, sequence_options = normalizer.(task, local_options, options, sequence_options)
|
|
106
105
|
|
|
107
106
|
return task, local_options, options, sequence_options
|
|
108
107
|
end
|
|
109
108
|
|
|
109
|
+
# Filter out connections, e.g. `Output(:fail_fast) => :success` and return only the keywords like `:id` or `:replace`.
|
|
110
|
+
def self.extract_dsl_keywords(options, connection_classes = [Activity::Output, DSL::Output::Semantic])
|
|
111
|
+
options.keys - options.keys.find_all { |k| connection_classes.include?( k.class ) }
|
|
112
|
+
end
|
|
113
|
+
|
|
110
114
|
# Low-level interface for DSL calls (e.g. Start, where "you know what you're doing")
|
|
111
115
|
# @private
|
|
112
116
|
def self.adds(id, task, initial_plus_poles, polarization, polarizations_from_user_options, options, sequence_options, magnetic_to = nil)
|