Commit Graph

234 Commits

Author SHA1 Message Date
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
David Hoover 92d1edd3e7 Ignore generated files 2011-07-01 11:38:47 -07:00
David Hoover b0737e3f2b Add missing @Overrides 2011-07-01 11:25:52 -07:00
Michael Bayne 753546a63c More stray tag character tests. 2011-06-21 22:00:37 -07:00
Michael Bayne 67d325624f Parser reorganization, parsing lenience++.
Reorganized the parser as a proper class so that I could easily reenter it to
deal with things like optional second open and close tag characters. In the
process, made the parser simply pass through certain kinds of malformed input
as text.

I hope to go further in this regard, avoiding parse exceptions in favor of
simply showing the user the malformed output unsubstituted. It's just as easy
to see "{{broken blah blah" in ones result template as it is to read exception
messages, and apps that wish to use JMustache for things like end-user
templates will find this much more agreeable.
2011-06-21 21:54:59 -07:00
Michael Bayne 2630e36cbd Reference the 1.3 release artifact. 2011-06-03 16:43:55 -07:00
Michael Bayne 553ab51357 [maven-release-plugin] prepare for next development iteration 2011-06-03 11:08:50 -07:00
Michael Bayne ca50fe0b15 [maven-release-plugin] prepare release jmustache-1.3 2011-06-03 11:08:45 -07:00
Michael Bayne 7c05c7ca05 Unwrap line. 2011-05-28 10:52:36 -07:00
Michael Bayne 7a282c03e5 Fixed booched Markdown tag. 2011-05-28 10:51:09 -07:00
Michael Bayne 9fae13e008 Added Compiler.nullValue() for situations where one wants to provide a value
for use when variables resolve to null, but still wishes for exceptions to be
thrown when values are not resolvable (i.e. are typos). Pre-existing behavior
is preserved if one uses defaultValue() or does not change the default
configuration.

Nota bene: there are complexities, so be sure to read the documentation.
2011-05-28 10:42:45 -07:00
Michael Bayne ef971015bd Resolves issue 7 regarding proper handling of nested contexts when processing a
nested context.
2011-05-26 14:52:45 -07:00
Michael Bayne 31d0a0985d Added usage for default values. 2011-04-15 12:45:54 -07:00
Michael Bayne 1be9c52589 Let's add a test illustrating that default values are used for variables which
resolve to null.
2011-04-15 12:39:16 -07:00
Michael Bayne 15ff48eabb Some tidying up, name changes and clarifications. I went with "defaultValue"
rather than "missingVariableValue" because the value is used any time a
variable resolves to null, not necessarily just when it is missing. If you
have a context like:

new Object() {
   String foo = null;
}

and reference {{foo}} in your template, foo is not missing, per se, but the
default value will still be used for it.
2011-04-15 12:35:33 -07:00
John Montgomery 5d59eada29 Added compiler option to provide defaults for missing values
Call missingVariableValue(value) on a Compiler object to get a new
version that will insert "value" for missing values (rather than
throwing an exception).  Useful when you have templates you would
rather generated *something* instead of erroring or for when objects may
have null values themselves.
2011-04-15 10:01:40 +01:00
Michael Bayne d04f2c2f76 Reference the latest release artifact. 2011-04-13 16:20:58 -07:00
Michael Bayne 6acca915b1 [maven-release-plugin] prepare for next development iteration 2011-04-13 16:18:42 -07:00
Michael Bayne b38f17ea0f [maven-release-plugin] prepare release jmustache-1.2 2011-04-13 16:18:35 -07:00
Michael Bayne 14e42bc984 Toned down caveat. 2011-04-13 15:44:13 -07:00
Michael Bayne 6b1551a1c9 Actually implemented delimiter change. Tidied things upalong the way. 2011-04-13 15:42:28 -07:00
Michael Bayne f34539850a Added blurb on standards mode. 2011-04-13 15:00:57 -07:00
Michael Bayne 9d8754b130 Fixed {{.}} doc typo. 2011-04-13 14:55:25 -07:00
Michael Bayne 03c02fba96 Formatting tweak. 2011-04-13 14:54:05 -07:00
Michael Bayne aa5a5bf3c4 Clarify partials documentation a touch. 2011-04-13 14:53:34 -07:00
Michael Bayne b1262c8edb Added documentation for {{.}}. 2011-04-13 14:50:18 -07:00
Michael Bayne ab0e1fdda4 Let's make Partials a subsection of Usage rather than a full top-level section. 2011-04-13 14:43:48 -07:00
Michael Bayne 5b81a46710 Added basic documentation on how to use partials support. 2011-04-13 14:43:17 -07:00
Michael Bayne a0bc4dc3b6 Test that names are being processed in partials; fixed exception on attempt to
use partials when unconfigured; moved partials tests down into a more sensible
location among the tests.
2011-04-13 14:42:30 -07:00
Michael Bayne 419a8b887c Fixed typo; restrict exception handling to just the loading of a partial
template; pass runtime exceptions through unwrapped.
2011-04-13 14:41:49 -07:00
Michael Bayne 0959ccd0d9 More tidying. 2011-04-13 14:25:41 -07:00
Michael Bayne ce389bd293 Cleaned up contributed template loading support. Moved MustacheTemplateLoader
into inner interface Mustache.TemplateLoader, eliminated top-level
UnsupportedTemplateLoader. Eliminated static configuration of active template
loader in favor of per-Compiler configured template loader, which is how all
other configuration is handled.More complex tests are needed, but will have to
wait until I'm less sleep deprived.
2011-04-13 11:49:59 -07:00
Michael Bayne e8641ba4fa We have interned strings here, so we can use reference equality to determine
whether we're seeing {{.}} or not. Also reinstated treatment of ".foo" as a
compound key. I'm not 100% sure that makes more sense than treating ".foo" as a
simple key, but I'd rather change less behavior than more when making the {{.}}
fix.
2011-04-13 11:38:26 -07:00
Sean Scanlon b3f5e1e960 tighten up fix for {{.}}
realizing previous commit would treat {{.foo}} the same as {{.}}
2011-03-27 16:18:17 -07:00
Sean Scanlon 095c6f9a59 fix for using {{.}} in non-standards mode
in non-standards mode (which is the default), {{.}} would be treated as a compound key, resulting in key not found exceptions.
2011-03-27 16:07:20 -07:00
Sean Scanlon 5fc751219e Add template loader hook for partials {{>template}} support.
This is implemented so that by default, the library does not support template loading (which it already does not)
but instead of treating partial calls as a context lookup for a ">key", an exception is thrown.
2011-03-27 15:53:04 -07:00
Michael Bayne 76f86ea665 [maven-release-plugin] prepare for next development iteration 2011-03-01 11:35:16 -08:00
Michael Bayne 13ac4f9b87 [maven-release-plugin] prepare release jmustache-1.1 2011-03-01 11:35:09 -08:00
Michael Bayne 4a1a125f87 Maybe these URLs will appease my fickle Maven mistress. 2011-03-01 11:34:20 -08:00
Michael Bayne c94782fd9b My release was borked, need to start over. Yay! 2011-03-01 11:31:55 -08:00
Michael Bayne 1d0f1b7a65 Prepare for 1.2-SNAPSHOT development. Go back to old GIT URL. I was apparently
using an ancient version of Maven that was not very GIT friendly.
2011-03-01 11:30:22 -08:00
Michael Bayne 74c19b2e5f [maven-release-plugin] prepare release jmustache-1.1 2011-03-01 11:28:44 -08:00
Michael Bayne d1d096ad84 Now I want some line wrapping. 2011-03-01 11:17:01 -08:00
Michael Bayne 6ca5e463da We'll need a git: in there to let Maven know what's going on. 2011-03-01 11:16:34 -08:00
Michael Bayne 7ed35d55b5 Maybe Maven will like the https GIT URL better? 2011-03-01 11:15:55 -08:00
Michael Bayne 4c2a118add Went back to a happy medium of density. 2011-02-28 20:30:23 -08:00