Skip to content
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

Gosh v2 #1

Merged
merged 20 commits into from
Mar 29, 2015
Merged

Gosh v2 #1

merged 20 commits into from
Mar 29, 2015

Conversation

warpfork
Copy link
Member

No description provided.

…e shake-up: most core components are going to become interfaces instead of concrete structures.

Here are the first of the major changes:

- process state is now a typed constant, and includes its own methods instead of heaping them onto the whole command observer struct
- the command observer system is now called `Proc` instead of `RunningCommand`
- the command observer system is now an interface instead stuck to a single concrete implementation
  - `ProcExec` is now just one implementation of `Proc`; you can make more!

The entire command templating system is, for the moment, dropped.  When it's revived, the "baking" behaviors will have become the exception, rather than the rule -- it's very rare (relatively) that you want to invoke the same command again and again with no args, which means requiring the nigh-invisible trailing `()` (or `Run()`) is lot more pain than it's worth.  Instead, we're going to look into ways to make the interface "DTRT" more when invoked with a series of string args that clearly meant to kick something off.

Tests are MISSING.  We're gonna get a clean start with those, too, using goconvey this time.

Note that I'd like to have placed the ProcExec implementation off in its own package, but if the main gosh package is to be able to invoke it without fuss, that'd result in import cycle issues, so it appears it's not meant to be.

Signed-off-by: Eric Myhre <hash@exultant.us>
Most of the old coverage is restored... and it's much terser and more wonderful with goconvey.  Some groups of checks still todo.

Added some time bounding assertions as well -- obviously these are inherently racy, but the lower bound is safe, and the margin on the upper bound is so big I dearly hope it's reasonable.  And of course, the happy path is not slow, because that's how you murder your iteration time.

Signed-off-by: Eric Myhre <hash@exultant.us>
Signed-off-by: Eric Myhre <hash@exultant.us>
Signed-off-by: Eric Myhre <hash@exultant.us>
Signed-off-by: Eric Myhre <hash@exultant.us>
…emplates and launching a proc.

Signed-off-by: Eric Myhre <hash@exultant.us>
Report process start error immediately if none.

Signed-off-by: Eric Myhre <hash@exultant.us>
Signed-off-by: Eric Myhre <hash@exultant.us>
Defaults to ExecLauncher.

Signed-off-by: Eric Myhre <hash@exultant.us>
If this is going to be used anytime you specify inputs or outputs, the name needs to be way, way shorter than 15 characters.

Signed-off-by: Eric Myhre <hash@exultant.us>
… execution. Restore all the exit-code checking behave for Run. Add documentation. Give it basic test coverage via some simple examples.

Signed-off-by: Eric Myhre <hash@exultant.us>
Signed-off-by: Eric Myhre <hash@exultant.us>
Signed-off-by: Eric Myhre <hash@exultant.us>
Gosh's first order of business is to act in the most desirable way in a scripting context.  A big application using it as a library probably doesn't want this behavior, but is also perfectly able to suffer an extra line of configuraton to disable it.

Signed-off-by: Eric Myhre <hash@exultant.us>
Tighten up some of the examples to use it.  They're now *actually* about as short as writing in bash.

(And the exclamation points in strings didn't even send anyone into a tizzy of researching their bashrc and environmental options wondering if bash is going to substitute something!)

Signed-off-by: Eric Myhre <hash@exultant.us>
Signed-off-by: Eric Myhre <hash@exultant.us>
Signed-off-by: Eric Myhre <hash@exultant.us>
Signed-off-by: Eric Myhre <hash@exultant.us>
Two fixes: make NullIO to actually have an effect; fix zero-arg Command invocation and n-arg invocation behaving differently (both should run-and-wait).

Signed-off-by: Eric Myhre <hash@exultant.us>
Signed-off-by: Eric Myhre <hash@exultant.us>
warpfork added a commit that referenced this pull request Mar 29, 2015
@warpfork warpfork merged commit c19a3c6 into master Mar 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant