-
Notifications
You must be signed in to change notification settings - Fork 29
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
Add segmented Scarpe app files, reuse more of exe/scarpe #369
Conversation
Here's a wiki page with the current format and reasoning for segmented apps: https://github.com/scarpe-team/scarpe/wiki/SegmentedApps.md If the code changes, obviously the wiki is subject to change (or deletion, if appropriate) as well. |
d28bebc
to
88f3ecc
Compare
e685c8c
to
57ff64d
Compare
…der when operations have to happen
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.
Very interesting discussion and thank you for the documentation.
I think the -.scas- approach, including frontmatter, how we'll throw in tests and metadata, is a mature move and a few of these things we've talked about for a while
Initially I was like "why can't we find a cutesy ruby way to store this with END, conventions and maybe a comment block (=begin style) at the top?"
But reading through this properly yeah, I like this direction and let's run with it.
As long as we keep our support for boring .rb style shoes apps we have as much room as we want to experiment with more stuff. And I'd love having the test right there.
I wonder if the syntax highlighter would complain?
I might as @vinistock at some point for tips and tricks on that.
And if you look at the loader approach, nothing stops us from doing both. We only do the segmented YAML thing for .scas files, and only for display services that opt into that. But it does a tiered approach where it will keep trying until some loader says yes. So if there was a way to recognise the __END__ thing, a loader could do that and do it for any non-scas files it felt like. |
Description
Two changes here. One, I extracted a lot of the interesting functionality in exe/scarpe into a scarpe_cli.rb file in Lacci. We can keep this pattern up for anything else that wants to be abstracted across multiple display libraries, but it doesn't actually need a command in Lacci. Probably better.
The other, as I've been saying for awhile, is that we want a way to start packaging multiple different chunks of code (in this case app and test) into a single combined Scarpe-specific app file. This is the simple version: add YAML front matter, divide chunks with a line containing at least 5 dashes. But we now have a really obvious way to add more test langs (identify which test lang in the front matter) and a really simple default (just eval the test code inside the Shoes::App object) that is still enough to package tests with the app if we want.
Eventually this should open up interesting options like a properly hosted-in-child reported-in-parent version of Minitest, which would be cleaner than the current jury-rigged assertion and reporting systems we use for most Scarpe Webview tests.
Image(if needed, helps for a faster review)
Checklist