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.
What is the purpose of this pull request?
Adds
import_template
command, as discussed in #2. (Resolves #2).What changes did you make? (overview)
import_template
method toRubyBytes::Compiler
, which creates a newCompiler
instance at the sub-template's path and renders it.DummyRailsTest
integration test was failing for me without any changes (I changed expected value from theparameterize
method torobobytes
rather thanrobo-bytes
), I included that fix in a separate commit on this PR)Is there anything you'd like reviewers to focus on?
Does creating a new
Compiler
seem like the best approach (this certainly seems like the simplest)?Thor implements its
inside
command using a stack of destinations, pushing and popping onto/from that stack to handle different working directories without having to create new objects to contain the state change.I'm happy with the simpler solution provided here - as far as I can see the main downside to this approach is extra object creation, but as I don't expect this to get used more than a handful of times per template, this seems like a reasonable tradeoff. Happy to reconsider if you feel differently, though.
Checklist