You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we can pass an actual slice instance into RubyFileWriter#directory, we could use our new Slice#source_path to make this simpler:
base = slice.source_path
This returns the appropriate value for both the app as well as slices, so it means we no longer need if app else slice conditionals everywhere, which has been a bother for the longest time :)
(Again, this would be another great refactor for post-merge, I don't want to hold anything up!)
When doing this, might be worth trying this other refactor for RubyFileWriter
Like you mentioned in the description, this is an internal class only so we can tolerate some slightly less ergonomic API design, but I think a refactor to allow a FileWriter instance to be initialised once and then used to write multiple files might be nice.
So this would probably pull the fs: and inflector: params out into #initialize, with the rest going into some method that writes an actual file.
I think this'd be worth playing with sometime, but it's not blocking and I'm definitely keen to get our full range of CLI commands ready for beta1 on Tuesday. So happy if this comes in a follow-up change of some kind :)
Originally posted by @timriley in #186 (comment)
The text was updated successfully, but these errors were encountered: