-
Notifications
You must be signed in to change notification settings - Fork 52
DSL: passing output data between steps #418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DSL: passing output data between steps #418
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
0a61e05 to
11a9669
Compare
11a9669 to
c7669a4
Compare
c3a6f64 to
ddbeaf3
Compare
c7669a4 to
4446c22
Compare
6e28202 to
9449467
Compare
4446c22 to
59c5cf7
Compare
9449467 to
e7c33fe
Compare
59c5cf7 to
6fbcf85
Compare
6fbcf85 to
991368a
Compare
991368a to
835c58e
Compare
835c58e to
9969561
Compare
| cmd(:ls) { "ls -al" } | ||
| cmd(:echo) do | ||
| # TODO: this is a bespoke output object for cmd, is there a generic one we can offer | ||
| first_line = cmd(:ls).command_output.split("\n").second |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i love this!
| end | ||
|
|
||
| attr_reader :output | ||
| attr_reader :name, :output |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes pls
| module Roast | ||
| module DSL | ||
| # Contains the cogs already executed in this run. | ||
| class CogExecutionContext |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be called something like CogInputContext, because the proc running in this context is just generating the input for the cog's actual work, which will be done by the cog itself not in a user's proc at all
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll drop a rename PR on top of this
9969561 to
342cb79
Compare
91fe471 to
4571b58
Compare
Merge activity
|

More context rebinding shenanigans. Inside of a cog level execution block,
cmd(:ls)returns the output object from executing that cog.If the cog has not yet run, it will error, preventing access of cog output before you could possibly have it.
Added a
CogExecutionContextto provide the execution environment for this purpose, and renamed the previousExecutionContexttoWorkflowExecutionContextto reflect its higher level purpose.