Commit Graph

129 Commits

Author SHA1 Message Date
Michael Bayne 31190d3cb5 Made createFetcherCache abstract.
GWT doesn't provide Collections.synchronizedMap so we can't default to that.
Because we don't want someone to extend BasicCollector on a multi-threaded
platform and get an unsynchronized HashMap, which would cause things to fail,
we instead make creatFetcherCache abstract and document that if you extend
BasicCollector, you need to return a synchronized map (if the platform you're
targeting is multithreaded).
2012-10-03 09:51:26 -07:00
Michael Bayne 4926b326b9 Preserve Java 5 compatibility. Yay! 2012-10-01 14:14:23 -07:00
Michael Bayne 5ec24e947c Use ConcurrentHashMap to cache fetchers, on platforms that support it. 2012-10-01 09:27:36 -07:00
Michael Bayne 41eec508cb [maven-release-plugin] prepare for next development iteration 2012-08-16 17:53:52 -07:00
Michael Bayne 21f2145222 [maven-release-plugin] prepare release jmustache-1.6 2012-08-16 17:53:45 -07:00
Michael Bayne 9f0bb84db3 Prep for 1.6 release. 2012-08-16 17:38:41 -07:00
Michael Bayne 69a772ab98 Preserve nesting with non-empty strings; tidying. 2012-08-13 14:36:17 -07:00
Michael Bayne a899c466ca Use latest test plugin. 2012-08-13 14:31:23 -07:00
Michael Bayne c10bb817da Merge pull request #20 from mick8569/master
Add option to treat empty string as falsy values
2012-08-13 14:18:38 -07:00
Michael Bayne 74b954e8be Merge pull request #19 from ContemplateLtd/for-upstream
Add Bundle-ActivationPolicy to OSGi manifest.
2012-08-13 14:16:47 -07:00
Mickael Jeanroy af91e58024 Add option to treat empty string as falsy value 2012-08-13 20:57:29 +02:00
Martin Ellis 049359cde3 Add Bundle-ActivationPolicy to OSGi manifest.
Set the Bundle-ActivationPolicy to 'lazy'. According to the OSGi wiki:

  "This can improve performance in a system with many bundles, where
  instead of starting them they may be placed into a lazy state, and
  only activated when they are actually used."
  -- http://wiki.osgi.org/wiki/Bundle-ActivationPolicy

'Lazy' is fine for jmustache, because it has no bundle activator,
and does not provide any OSGi services that need to be registered.
2012-08-13 14:42:47 +01:00
Michael Bayne a7f0e92d92 Merge pull request #18 from martiell/master
Use entity number when escaping apostrophes for IE compatibility.
2012-06-12 16:02:42 -07:00
Martin Ellis 1578aa0920 Escape apostrophe's using entity number (') rather than name (').
The ' entity is an XML entity, rather than an HTML entity, and is not
supported by Internet Explorer. The numeric form is supported in both XML
and HTML.
2012-06-12 17:12:54 +01:00
Michael Bayne a1808fb3ef POM tidying. 2012-06-08 08:34:48 -07:00
Michael Bayne 56f87c93ab Merge pull request #16 from martiell/master
Add OSGi headers in manifest file using maven-bundle-plugin.
2012-06-08 08:31:35 -07:00
Martin Ellis 77991e52bb Add OSGi headers in manifest file using maven-bundle-plugin.
Some of the automatically generated headers are suppressed because
they are for information only, and not very useful. These include
Bnd-LastModified, Include-Resource, Private-Package and Tool.
2012-05-25 15:54:39 +01:00
Michael Bayne 11cfdf87e5 Merge pull request #15 from skaba/master
Java5 compatibility
2012-04-13 09:24:43 -07:00
Serkan Kaba ffe46f5865 Make the code Java5 compatible. 2012-04-10 14:26:57 +02:00
Michael Bayne 75da7d3e76 Only compile a lazily loaded template once. Also fixed styles. 2012-04-09 11:15:56 -07:00
Michael Bayne 37fbeb2bbd Merge pull request #14 from skaba/master
Fixes issue #13
2012-04-09 11:08:27 -07:00
serkan 4d9a664214 Fix infinite recursion. 2012-04-06 16:33:21 +02:00
Michael Bayne 7701880092 Update download links to latest release version (1.5). 2011-11-22 11:43:55 -08:00
Michael Bayne 718639127e Added comments and squeezed into 100 columns. 2011-11-22 11:40:09 -08:00
Michael Bayne 84b8f08634 Merge pull request #11 from jlewallen/parent-context
Add a Template.execute that takes a parent context.
2011-11-22 11:37:31 -08:00
Jacob Lewallen 1a06a0233a Add a Template.execute that takes a parent context. 2011-11-22 11:20:59 -08:00
Michael Bayne 751123c067 [maven-release-plugin] prepare for next development iteration 2011-11-13 08:53:24 -08:00
Michael Bayne ab3d6206e0 [maven-release-plugin] prepare release jmustache-1.5 2011-11-13 08:53:17 -08:00
Michael Bayne d51cd7e08a Reader and Writer are abstract classes. GWT tests work now. Yay! 2011-10-29 15:50:41 -07:00
Michael Bayne 407d999836 Further work on making JMustache work in GWT.
I've ironed out most of the kinks, but the GWT unit test still fails because
we're forced to do some sneaky things with java.io.Reader/Writer. I think it
will all work when compiled to JavaScript, so I need to check it in a real
project.
2011-10-29 15:31:27 -07:00
Michael Bayne f9319ce911 Added a header. 2011-10-29 15:31:03 -07:00
Michael Bayne f6c6f4916c Pass the context instance itself instead of its class.
In GWT we can't use Class.isAssignableFrom. We need the original instance so
that we can do (ctx instanceof Map<?,?>).
2011-10-29 15:29:18 -07:00
Michael Bayne 69826a707e Nixed limitations list. One was obsolete and the other is in the README. 2011-10-29 14:45:24 -07:00
Michael Bayne a5e7c2ebb8 Switch CompoundSegment to BlockSegment. Avoids overloading use of the term
compound, which I use for compound variables.
2011-10-29 14:41:27 -07:00
Michael Bayne adf116992c Modified compound variables to honor null/default configuration. Closes #10.
Kali/Bertrand convinced me that being consistent with other Mustache
implementations is more important than whatever wacky reasons I was harboring
for keeping compound variables different than singleton sections.
2011-10-29 14:38:56 -07:00
Michael Bayne 37884af44d Fixed thinko. 2011-10-29 13:19:16 -07:00
Michael Bayne 8ce01cd060 Added missing bangs, nixed quotes. 2011-10-29 13:17:56 -07:00
Michael Bayne 66ba7c8cf8 Added additional information about compound keys and null/default values. 2011-10-29 13:14:02 -07:00
Michael Bayne 0a27e6ce4d Added an SBT build so that I can deploy to Ivy. 2011-10-13 20:49:47 -07:00
Michael Bayne 627da759c7 Include sources in jar for (eventual) GWT usage. 2011-10-13 20:49:33 -07:00
Michael Bayne c67f6aeac5 Oh yeah, we need a way to plug in a custom collector. 2011-10-13 20:39:39 -07:00
Michael Bayne 76e9d54683 Extracted the iteration over collections and creation of variable fetchers into
a pluggable component.

This allows scaling down to the GWT environment by hiding the reflection code
via GWT's super source mechanism.

And it allows scaling up to non-Java languages (like Scala) by allowing the
library client to extend the DefaultCollector and teach it about Scala
Iterators, Iterables and Maps.

I also just realized that GWT has no facilities for Reader and Writer, which is
going to complicate making things work in GWT even further. But for now, I'll
just leave things as is.
2011-10-13 20:35:46 -07:00
Michael Bayne 2b6066adce [maven-release-plugin] prepare for next development iteration 2011-08-29 14:50:49 -07:00
Michael Bayne 447b109512 [maven-release-plugin] prepare release jmustache-1.4 2011-08-29 14:50:40 -07:00
Michael Bayne 4367ff6784 Only skip newlines if a tag is the only thing on the line.
Otherwise you get undesirable newline skipping if you do things like, for
example:

{{#foos}}
{{bar}}{{^-last}}, {{/-last}}
{{/foos}}

where you want the newline after {{/-last}}, but it was getting skipped.
2011-08-29 14:44:17 -07:00
Michael Bayne a3eb9e22e1 Fixed bug where -last was not correctly handled on lists of a single element,
where said element is both -first and -last.
2011-08-29 13:51:11 -07:00
Michael Bayne 28978548c5 Wrapped some long lines. 2011-08-29 13:42:11 -07:00
Michael Bayne 71fdc8aa33 Specify correct license in POM. 2011-08-26 11:26:41 -07:00
Michael Bayne 7255cb7c09 We keep the @Override on the same line round these parts. 2011-07-17 08:38:20 -07:00
Michael Bayne 3122c2c770 Merge pull request #8 from deadmoose/master
Ignores/overrides
2011-07-17 08:37:17 -07:00