trailblazer-developer 0.0.13 → 0.0.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +6 -5
- data/{lib/trailblazer/developer/CHANGES.md → CHANGES.md} +19 -0
- data/Gemfile +0 -1
- data/LICENSE +1 -1
- data/README.md +1 -1
- data/Rakefile +0 -3
- data/gems.local.rb +3 -0
- data/lib/trailblazer/developer/client.rb +2 -2
- data/lib/trailblazer/developer/generate.rb +7 -6
- data/lib/trailblazer/developer/render/circuit.rb +1 -1
- data/lib/trailblazer/developer/trace.rb +3 -3
- data/lib/trailblazer/developer/trace/present.rb +4 -2
- data/lib/trailblazer/developer/version.rb +1 -1
- data/lib/trailblazer/developer/wtf.rb +9 -8
- data/lib/trailblazer/developer/wtf/renderer.rb +4 -0
- data/trailblazer-developer.gemspec +1 -2
- metadata +9 -24
- data/.rubocop.yml +0 -36
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 681f1eca62302de70e8e138f58ad0f2765bc08a5fbbb3d1eb17d10e88ac479e6
|
4
|
+
data.tar.gz: 96f1f8056ed5381c6b8f7c9264728121bb31e5928092889cf88d6ed2687ce154
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70239ee2b542f1565b1a11e583611499c541bec4be99a38646881bdf12b679180ecdd08f0f67fcfb944469ad7cf9d6b221c90e46e99b6b041ef3473f7089e8fa
|
7
|
+
data.tar.gz: 64fd52e4e29c849f807bd06b1e747198feb37c9ad9c51e699569fb1eb2c05aea735754fd299526d140c771463411bd3c7d698e6bbe8736e8c812a804b5121f98
|
data/.travis.yml
CHANGED
@@ -1,3 +1,22 @@
|
|
1
|
+
# 0.0.20
|
2
|
+
* Ruby 2.7 support
|
3
|
+
|
4
|
+
# 0.0.17
|
5
|
+
|
6
|
+
* Add `Arrow.target_lane` field in the `Generate` component.
|
7
|
+
|
8
|
+
# 0.0.16
|
9
|
+
|
10
|
+
* Remove Declarative warning correctly
|
11
|
+
|
12
|
+
# 0.0.15
|
13
|
+
|
14
|
+
* Fix `Dev.wtf` circuit interface definition
|
15
|
+
|
16
|
+
# 0.0.14
|
17
|
+
|
18
|
+
* Revert declarative warning changes
|
19
|
+
|
1
20
|
# 0.0.13
|
2
21
|
|
3
22
|
* Allow focusing on selected variables for all steps in wtf
|
data/Gemfile
CHANGED
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -4,7 +4,7 @@ _Developer tools for Trailblazers._
|
|
4
4
|
|
5
5
|
## Documentation
|
6
6
|
|
7
|
-
Find the complete documentation on the project website: [
|
7
|
+
Find the complete documentation on the project website: [https://trailblazer.to/2.1/docs/trailblazer.html#trailblazer-developer]
|
8
8
|
|
9
9
|
## Summary
|
10
10
|
|
data/Rakefile
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
2
|
require "rake/testtask"
|
3
|
-
require "rubocop/rake_task"
|
4
3
|
|
5
4
|
Rake::TestTask.new(:test) do |t|
|
6
5
|
t.libs << "test"
|
@@ -8,7 +7,5 @@ Rake::TestTask.new(:test) do |t|
|
|
8
7
|
t.test_files = FileList["test/**/*_test.rb"]
|
9
8
|
end
|
10
9
|
|
11
|
-
RuboCop::RakeTask.new(:rubocop)
|
12
|
-
|
13
10
|
desc "Running Tests"
|
14
11
|
task default: %i[test]
|
data/gems.local.rb
CHANGED
@@ -31,7 +31,7 @@ module Trailblazer::Developer
|
|
31
31
|
return false unless response.status == 200
|
32
32
|
|
33
33
|
# token = CGI::Cookie.parse(response.headers["set-cookie"])["token"][0]
|
34
|
-
|
34
|
+
JSON.parse(response.body)["token"]
|
35
35
|
end
|
36
36
|
|
37
37
|
def export_diagram(id:, query:, **options)
|
@@ -60,7 +60,7 @@ module Trailblazer::Developer
|
|
60
60
|
def request(host:, url:, method:, token:, body:, **)
|
61
61
|
conn = Faraday.new(url: host)
|
62
62
|
|
63
|
-
|
63
|
+
conn.send(method) do |req|
|
64
64
|
req.url url
|
65
65
|
req.headers["Content-Type"] = "application/json"
|
66
66
|
req.body = body
|
@@ -8,7 +8,7 @@ module Trailblazer
|
|
8
8
|
module_function
|
9
9
|
|
10
10
|
Element = Struct.new(:id, :type, :linksTo, :data, :label, :parent)
|
11
|
-
Arrow = Struct.new(:target, :label, :message)
|
11
|
+
Arrow = Struct.new(:target, :label, :message, :target_lane)
|
12
12
|
|
13
13
|
module Representer
|
14
14
|
class Activity < Representable::Decorator
|
@@ -17,10 +17,11 @@ module Trailblazer
|
|
17
17
|
collection :elements, class: Element do
|
18
18
|
property :id
|
19
19
|
property :type
|
20
|
-
collection :linksTo, class: Arrow, default:
|
20
|
+
collection :linksTo, class: Arrow, default: ::Declarative::Variables::Append([]) do
|
21
21
|
property :target
|
22
22
|
property :label
|
23
23
|
property :message
|
24
|
+
property :target_lane
|
24
25
|
end
|
25
26
|
property :data, default: {}
|
26
27
|
|
@@ -31,7 +32,7 @@ module Trailblazer
|
|
31
32
|
end
|
32
33
|
|
33
34
|
def call(hash)
|
34
|
-
|
35
|
+
_, (ctx, _) = Activity::TaskWrap.invoke(Pipeline, hash: hash)
|
35
36
|
ctx[:intermediate]
|
36
37
|
end
|
37
38
|
|
@@ -51,16 +52,16 @@ module Trailblazer
|
|
51
52
|
wiring = elements.collect { |el|
|
52
53
|
data = data_for(el)
|
53
54
|
|
54
|
-
[inter.TaskRef(el.id, data), el.linksTo.collect { |arrow| inter.Out(semantic_for(arrow.to_h), arrow.target) } ] }
|
55
|
+
[inter.TaskRef(el.id, data), el.linksTo.collect { |arrow| inter.Out(semantic_for(**arrow.to_h), arrow.target) } ] }
|
55
56
|
wiring = Hash[wiring]
|
56
57
|
|
57
58
|
# end events need this stupid special handling
|
58
59
|
# DISCUSS: currently, the END-SEMANTIC is read from the event's label.
|
59
60
|
wiring = wiring.merge(Hash[
|
60
61
|
end_events.collect do |_end|
|
61
|
-
ref,
|
62
|
+
ref, = wiring.find { |ref, _| ref.id == _end.id }
|
62
63
|
|
63
|
-
[ref, [inter.Out(semantic_for(_end.to_h)|| raise, nil)]] # TODO: test the raise, happens when the semantic of an End can't be distinguished. # TODO: don't extract semantic from :label but from :data.
|
64
|
+
[ref, [inter.Out(semantic_for(**_end.to_h)|| raise, nil)]] # TODO: test the raise, happens when the semantic of an End can't be distinguished. # TODO: don't extract semantic from :label but from :data.
|
64
65
|
end
|
65
66
|
])
|
66
67
|
# pp wiring
|
@@ -7,10 +7,10 @@ module Trailblazer::Developer
|
|
7
7
|
|
8
8
|
class << self
|
9
9
|
# Public entry point to activate tracing when running {activity}.
|
10
|
-
def call(activity, (ctx, flow_options), circuit_options
|
11
|
-
activity, (ctx, flow_options), circuit_options = Trace.arguments_for_call( activity, [ctx, flow_options], circuit_options ) # only run once for the entire circuit!
|
10
|
+
def call(activity, (ctx, flow_options), **circuit_options)
|
11
|
+
activity, (ctx, flow_options), circuit_options = Trace.arguments_for_call( activity, [ctx, flow_options], **circuit_options ) # only run once for the entire circuit!
|
12
12
|
|
13
|
-
signal, (ctx, flow_options) = Activity::TaskWrap.invoke(activity, [ctx, flow_options], circuit_options)
|
13
|
+
signal, (ctx, flow_options) = Activity::TaskWrap.invoke(activity, [ctx, flow_options], **circuit_options)
|
14
14
|
|
15
15
|
return flow_options[:stack], signal, [ctx, flow_options]
|
16
16
|
end
|
@@ -14,7 +14,8 @@ module Trailblazer::Developer
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def tree(stack, level, tree:, renderer:, **options)
|
17
|
-
|
17
|
+
opts = options.merge(tree: tree)
|
18
|
+
tree_for(stack, level, **opts)
|
18
19
|
|
19
20
|
nodes = tree.each_with_index.map do |task_node, position|
|
20
21
|
renderer.(task_node: task_node, position: position, tree: tree)
|
@@ -30,7 +31,8 @@ module Trailblazer::Developer
|
|
30
31
|
tree.push(*TreeNodes.for(level, options.merge(input: input, output: output)))
|
31
32
|
|
32
33
|
if nested.any? # nesting
|
33
|
-
|
34
|
+
opts = options.merge(tree: tree)
|
35
|
+
tree_for(nested, level + 1, **opts)
|
34
36
|
end
|
35
37
|
|
36
38
|
tree
|
@@ -14,13 +14,13 @@ module Trailblazer::Developer
|
|
14
14
|
|
15
15
|
# Run {activity} with tracing enabled and inject a mutable {Stack} instance.
|
16
16
|
# This allows to display the trace even when an exception happened
|
17
|
-
def invoke(activity, (ctx, flow_options),
|
17
|
+
def invoke(activity, (ctx, flow_options), **circuit_options)
|
18
18
|
activity, (ctx, flow_options), circuit_options = Wtf.arguments_for_trace(
|
19
|
-
activity, [ctx, flow_options],
|
19
|
+
activity, [ctx, flow_options], circuit_options
|
20
20
|
)
|
21
21
|
|
22
22
|
_returned_stack, signal, (ctx, flow_options) = Trace.invoke(
|
23
|
-
activity, [ctx, flow_options],
|
23
|
+
activity, [ctx, flow_options], circuit_options
|
24
24
|
)
|
25
25
|
|
26
26
|
return signal, [ctx, flow_options], circuit_options
|
@@ -52,7 +52,7 @@ module Trailblazer::Developer
|
|
52
52
|
variables: Array( flow_options.dig(:focus_on, :variables) ),
|
53
53
|
}
|
54
54
|
|
55
|
-
|
55
|
+
[activity, [ ctx, flow_options ], circuit_options]
|
56
56
|
end
|
57
57
|
|
58
58
|
# Overring default input and output data collectors to collect/capture
|
@@ -61,7 +61,7 @@ module Trailblazer::Developer
|
|
61
61
|
def trace_input_data_collector(wrap_config, (ctx, flow_options), circuit_options)
|
62
62
|
data = Trace.default_input_data_collector(wrap_config, [ctx, flow_options], circuit_options)
|
63
63
|
|
64
|
-
if Wtf.
|
64
|
+
if Wtf.capture_variables?(step_name: data[:task_name], **flow_options)
|
65
65
|
data[:focused_variables] = Trace::Focusable.capture_variables_from(ctx, **flow_options)
|
66
66
|
end
|
67
67
|
|
@@ -72,7 +72,7 @@ module Trailblazer::Developer
|
|
72
72
|
data = Trace.default_output_data_collector(wrap_config, [ctx, flow_options], circuit_options)
|
73
73
|
input = flow_options[:stack].top
|
74
74
|
|
75
|
-
if Wtf.
|
75
|
+
if Wtf.capture_variables?(step_name: input.data[:task_name], **flow_options)
|
76
76
|
data[:focused_variables] = Trace::Focusable.capture_variables_from(ctx, **flow_options)
|
77
77
|
end
|
78
78
|
|
@@ -80,10 +80,11 @@ module Trailblazer::Developer
|
|
80
80
|
end
|
81
81
|
|
82
82
|
# private
|
83
|
-
def
|
83
|
+
def capture_variables?(step_name:, focus_on:, **)
|
84
84
|
return true if focus_on[:steps].include?(step_name) # For given step
|
85
85
|
return true if focus_on[:steps].empty? && focus_on[:variables].any? # For selected vars but all steps
|
86
|
-
|
86
|
+
|
87
|
+
false
|
87
88
|
end
|
88
89
|
end
|
89
90
|
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
|
1
2
|
module Trailblazer::Developer
|
2
3
|
module Wtf
|
3
4
|
|
@@ -35,6 +36,9 @@ module Trailblazer::Developer
|
|
35
36
|
end
|
36
37
|
|
37
38
|
def fmt(line, style)
|
39
|
+
if line.is_a? Method
|
40
|
+
line = "#<Method: #<Class:>.#{line.name}>"
|
41
|
+
end
|
38
42
|
return line unless style
|
39
43
|
String.send(style, line)
|
40
44
|
end
|
@@ -22,9 +22,8 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.add_development_dependency "minitest"
|
23
23
|
spec.add_development_dependency "minitest-line"
|
24
24
|
spec.add_development_dependency "rake"
|
25
|
-
spec.add_development_dependency "rubocop"
|
26
25
|
|
27
|
-
spec.add_dependency "trailblazer-activity", ">= 0.
|
26
|
+
spec.add_dependency "trailblazer-activity", ">= 0.11.0", "< 1.0.0"
|
28
27
|
spec.add_dependency "trailblazer-activity-dsl-linear"
|
29
28
|
spec.add_dependency "representable"
|
30
29
|
spec.add_dependency "hirb"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trailblazer-developer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Sutterer
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -66,27 +66,13 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: rubocop
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
83
69
|
- !ruby/object:Gem::Dependency
|
84
70
|
name: trailblazer-activity
|
85
71
|
requirement: !ruby/object:Gem::Requirement
|
86
72
|
requirements:
|
87
73
|
- - ">="
|
88
74
|
- !ruby/object:Gem::Version
|
89
|
-
version: 0.
|
75
|
+
version: 0.11.0
|
90
76
|
- - "<"
|
91
77
|
- !ruby/object:Gem::Version
|
92
78
|
version: 1.0.0
|
@@ -96,7 +82,7 @@ dependencies:
|
|
96
82
|
requirements:
|
97
83
|
- - ">="
|
98
84
|
- !ruby/object:Gem::Version
|
99
|
-
version: 0.
|
85
|
+
version: 0.11.0
|
100
86
|
- - "<"
|
101
87
|
- !ruby/object:Gem::Version
|
102
88
|
version: 1.0.0
|
@@ -150,8 +136,8 @@ extensions: []
|
|
150
136
|
extra_rdoc_files: []
|
151
137
|
files:
|
152
138
|
- ".gitignore"
|
153
|
-
- ".rubocop.yml"
|
154
139
|
- ".travis.yml"
|
140
|
+
- CHANGES.md
|
155
141
|
- Gemfile
|
156
142
|
- LICENSE
|
157
143
|
- README.md
|
@@ -160,7 +146,6 @@ files:
|
|
160
146
|
- bin/setup
|
161
147
|
- gems.local.rb
|
162
148
|
- lib/trailblazer/developer.rb
|
163
|
-
- lib/trailblazer/developer/CHANGES.md
|
164
149
|
- lib/trailblazer/developer/client.rb
|
165
150
|
- lib/trailblazer/developer/generate.rb
|
166
151
|
- lib/trailblazer/developer/render/circuit.rb
|
@@ -178,7 +163,7 @@ homepage: http://trailblazer.to
|
|
178
163
|
licenses:
|
179
164
|
- LGPL-3.0
|
180
165
|
metadata: {}
|
181
|
-
post_install_message:
|
166
|
+
post_install_message:
|
182
167
|
rdoc_options: []
|
183
168
|
require_paths:
|
184
169
|
- lib
|
@@ -193,8 +178,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
193
178
|
- !ruby/object:Gem::Version
|
194
179
|
version: '0'
|
195
180
|
requirements: []
|
196
|
-
rubygems_version: 3.
|
197
|
-
signing_key:
|
181
|
+
rubygems_version: 3.1.2
|
182
|
+
signing_key:
|
198
183
|
specification_version: 4
|
199
184
|
summary: Developer tools for Trailblazer.
|
200
185
|
test_files: []
|
data/.rubocop.yml
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
inherit_from:
|
2
|
-
- https://raw.githubusercontent.com/trailblazer/meta/master/rubocop.yml
|
3
|
-
|
4
|
-
AllCops:
|
5
|
-
TargetRubyVersion: 2.5
|
6
|
-
Exclude:
|
7
|
-
- 'test/hash/bla.rb'
|
8
|
-
|
9
|
-
Metrics/LineLength:
|
10
|
-
Exclude:
|
11
|
-
- test/diagram_test.rb
|
12
|
-
|
13
|
-
Naming/MethodName:
|
14
|
-
Enabled: false
|
15
|
-
|
16
|
-
Style/ClassAndModuleChildren:
|
17
|
-
Enabled: false
|
18
|
-
|
19
|
-
# DISCUSS: user map instead of collect
|
20
|
-
Style/CollectionMethods:
|
21
|
-
Enabled: false
|
22
|
-
|
23
|
-
# DISCUSS: Use raise with an explicit exception class and message, rather than just a message
|
24
|
-
Style/ImplicitRuntimeError:
|
25
|
-
Enabled: false
|
26
|
-
|
27
|
-
Style/Lambda:
|
28
|
-
EnforcedStyle: literal
|
29
|
-
|
30
|
-
# DISCUSS: Use fail instead of raise to signal exceptions
|
31
|
-
Style/SignalException:
|
32
|
-
Enabled: false
|
33
|
-
|
34
|
-
# DISUSS: this could be false because we have if locals blabla
|
35
|
-
Bundler/DuplicatedGem:
|
36
|
-
Enabled: false
|