Just Published Mustache for VA Smalltalk to VASTGoodies

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Just Published Mustache for VA Smalltalk to VASTGoodies

jtuchel
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.

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.
Reply | Threaded
Open this post in threaded view
|

Re: Just Published Mustache for VA Smalltalk to VASTGoodies

Mariano Martinez Peck-2


On Fri, Jan 25, 2019 at 1:40 PM Joachim Tuchel <[hidden email]> wrote:
Hi there,


Hi Joachim,
 
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.


Thanks for sharing that to the community!

 
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.

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)

 
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.


We will comment about this in a separate email :)
 
In short: it is a library that lets you fill in placeholders in text, like this: {{customer.address.streetName}}


Once again, thanks for sharing!!! Very much appreciated. 
 
Best regards,

--
Mariano Martinez Peck
Software Engineer, Instantiations Inc.
[hidden email]

--
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.