Hi there, I needed something to merge text into HTML templates and #bindWith: as well as #expandMacrosWith: do not work in that field. So I ported Mustache from Pharo including tests and published that to VASTGoodies.com. I did not port the FileSystem related stuff (just two methods, but the differences between Pharo and VAST were too much for my schedule), so the related tests are also commented out. I also didn't take a look at Mustache-Cli in Pharo. The remaining tests are green, so I assume the port is done, as long as only Streams and Strings are being used as templates. Please feel free to add the missing functionalities. Thanks to Norbert Hartl and the Pharo Community for making this possible! I was impressed how little code Mustache actually needs... Seems Smalltalk is a mighty environment and we're standing on the shoulders of giants. And I think the design of the code is very neat! The port was quite straightforward, the biggest problems were the {} syntax for Array creation in Pharo code and a few differences between Pharo and VAST in the Collection Hierarchy and in Character. IIUC, the former will soon be solved for Pharo sources in Tonel format. You can find the code here: http://vastgoodies.com/projects/Mustache%2520for%2520Smalltalk If you have no idea what Mustache is or does, take a look at this document: https://ci.inria.fr/pharo-contribution/job/EnterprisePharoBook/lastSuccessfulBuild/artifact/book-result/Mustache/Mustache.html In short: it is a library that lets you fill in placeholders in text, like this: {{customer.address.streetName}} Have fun Joachim You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. Visit this group at https://groups.google.com/group/va-smalltalk. For more options, visit https://groups.google.com/d/optout. |
On Fri, Jan 25, 2019 at 1:40 PM Joachim Tuchel <[hidden email]> wrote:
Hi Joachim,
Thanks for sharing that to the community!
One little thing I try to do when I make ports and I know some tests are gonna fail, is to put them under #expectedFailures rather than commented out. That way: 1) You get green results, yet know that you have some expected failures 2) Its easy for everyone to know which parts may need an extra work .... it is way easier to see at the expected failures in the test results than checking which test methods are commented. 3) If the test methods do not compile, then sure, you can comment the original source and let a "self fail" together with the inclusion in #expectedFailure. 4) Unless you need 3) with this way you can even differ less from the upstream project and that will ease future ports... as all you need to do is to add it in expectedFailures (which normally you can do it as an extension method in some VAST-specific app)
We will comment about this in a separate email :)
Once again, thanks for sharing!!! Very much appreciated. Best regards, You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. Visit this group at https://groups.google.com/group/va-smalltalk. For more options, visit https://groups.google.com/d/optout. |
Free forum by Nabble | Edit this page |