Add some extra context for transforms and support single file gobbling #29
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There are no tests (yet?) - RFC
This is a combo of #23 and #24.
#23 Single file
If the gobbled target is a single file, the Source creates a temporary directory and assigns it as the
dir
. A watch is placed on thedir
as usual, but one is also set on the file. When the file changes, sander copies the new file into the temp dir, which triggers the watch ondir
as usual.I wasn't really sure where to put the temp dir, since there could be one of three different
.gobble*
directories in play during any given run. Thesession.config
is not available at Source creation time, so I went with.gobble-tmp
for now.#24 Context
There are a couple of additions to the contexts for transforms:
env
to the context with which transforms are called.info
event to be emitted for the cli (or whatever, I suppose) to log. It has a plain text/format overload along with the straight pass-through object flavor. The text overload keeps the progress pills popping.There is a PR on gobble-cli to help with logging. gobblejs/gobble-cli#5