tag:github.com,2008:https://github.com/codeka/carrot/releasesRelease notes from carrot2020-05-22T16:51:11Ztag:github.com,2008:Repository/25750754/2.4.52020-05-22T17:57:44Z2.4.5<p>For Issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="620386339" data-permission-text="Title is private" data-url="https://github.com/codeka/carrot/issues/38" data-hovercard-type="issue" data-hovercard-url="/codeka/carrot/issues/38/hovercard" href="https://github.com/codeka/carrot/issues/38">#38</a>, added an <a href="https://en.wikipedia.org/wiki/Elvis_operator" rel="nofollow">elvis operator</a>. See <a href="http://codeka.github.io/carrot/expressions.html" rel="nofollow">the docs</a> for details.</p>
<p>As with previous releases, the recommended approach for using Carrot is via Maven or Gradle:</p>
<p>With Maven:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="<dependency>
<groupId>au.com.codeka</groupId>
<artifactId>carrot</artifactId>
<version>2.4.5</version>
</dependency>"><pre class="notranslate"><code><dependency>
<groupId>au.com.codeka</groupId>
<artifactId>carrot</artifactId>
<version>2.4.5</version>
</dependency>
</code></pre></div>
<p>With Gradle:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="implementation 'au.com.codeka:carrot:2.4.5'"><pre class="notranslate"><code>implementation 'au.com.codeka:carrot:2.4.5'
</code></pre></div>codekatag:github.com,2008:Repository/25750754/2.4.42020-04-09T21:17:21Z2.4.4<p>Mostly just some internal cleanups. The one user-visible change is I removed a warning when an <code>{% extends %}</code> tag includes whitespace text.</p>
<p>As with previous releases, the recommended approach for using Carrot is via Maven or Gradle:</p>
<p>With Maven:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="<dependency>
<groupId>au.com.codeka</groupId>
<artifactId>carrot</artifactId>
<version>2.4.4</version>
</dependency>"><pre class="notranslate"><code><dependency>
<groupId>au.com.codeka</groupId>
<artifactId>carrot</artifactId>
<version>2.4.4</version>
</dependency>
</code></pre></div>
<p>With Gradle:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="implementation 'au.com.codeka:carrot:2.4.4'"><pre class="notranslate"><code>implementation 'au.com.codeka:carrot:2.4.4'
</code></pre></div>codekatag:github.com,2008:Repository/25750754/2.4.32020-01-09T05:40:23Z2.4.3<p>Two minor enhancements in this release:</p>
<p>Issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="414695490" data-permission-text="Title is private" data-url="https://github.com/codeka/carrot/issues/32" data-hovercard-type="issue" data-hovercard-url="/codeka/carrot/issues/32/hovercard" href="https://github.com/codeka/carrot/issues/32">#32</a> String concatentation. Now you can do things like:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{% set a = "foo" %}
{% set b = "bar" %}
{{ a + b }}"><pre class="notranslate"><code>{% set a = "foo" %}
{% set b = "bar" %}
{{ a + b }}
</code></pre></div>
<p>Issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="545906536" data-permission-text="Title is private" data-url="https://github.com/codeka/carrot/issues/37" data-hovercard-type="issue" data-hovercard-url="/codeka/carrot/issues/37/hovercard" href="https://github.com/codeka/carrot/issues/37">#37</a> Escaping Java variables names. Normally, all identifiers in Carrot are Java identifiers (because we typically expect you to be querying Java objects). But if not and you want some otherwise disallowed characters in your set variables, for example, you can:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{{ my\-var }}"><pre class="notranslate"><code>{{ my\-var }}
</code></pre></div>
<p>Will output the contents of variable "my-var".</p>
<p>As with previous releases, the recommended approach for using Carrot is via Maven or Gradle:</p>
<p>With Maven:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="<dependency>
<groupId>au.com.codeka</groupId>
<artifactId>carrot</artifactId>
<version>2.4.3</version>
</dependency>"><pre class="notranslate"><code><dependency>
<groupId>au.com.codeka</groupId>
<artifactId>carrot</artifactId>
<version>2.4.3</version>
</dependency>
</code></pre></div>
<p>With Gradle:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="compile 'au.com.codeka:carrot:2.4.3'"><pre class="notranslate"><code>compile 'au.com.codeka:carrot:2.4.3'
</code></pre></div>codekatag:github.com,2008:Repository/25750754/v2.4.22018-11-30T22:04:43Zv2.4.2<p>This release adds a new type of operator, the ternary operator. See <a href="http://codeka.github.io/carrot/expressions.html" rel="nofollow">the documentation</a> for more, but now you can do something like:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{{ foo == 0 ? "zero" : foo }}"><pre class="notranslate"><code>{{ foo == 0 ? "zero" : foo }}
</code></pre></div>
<p>Just like you would in normal Java.</p>
<p>As with previous releases, the recommended approach for using Carrot is via Maven or Gradle:</p>
<p>With Maven:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="<dependency>
<groupId>au.com.codeka</groupId>
<artifactId>carrot</artifactId>
<version>2.4.2</version>
</dependency>"><pre class="notranslate"><code><dependency>
<groupId>au.com.codeka</groupId>
<artifactId>carrot</artifactId>
<version>2.4.2</version>
</dependency>
</code></pre></div>
<p>With Gradle:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="compile 'au.com.codeka:carrot:2.4.2'"><pre class="notranslate"><code>compile 'au.com.codeka:carrot:2.4.2'
</code></pre></div>codekatag:github.com,2008:Repository/25750754/v2.4.12017-10-03T15:03:02Zv2.4.1<p>This is a minor bugfix release. There was one new addition, however.</p>
<ul>
<li>You can pass values to an <code>{% include %}</code> tag (see <a href="http://codeka.github.io/carrot/tags/include.html" rel="nofollow">the documentation</a>)</li>
<li>Fixed handling of null values</li>
<li>Don't swallow <code>}</code> or <code>{</code> at the very end of the input</li>
</ul>
<p>As with previous releases, the recommended approach for using Carrot is via Maven or Gradle:</p>
<p>With Maven:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="<dependency>
<groupId>au.com.codeka</groupId>
<artifactId>carrot</artifactId>
<version>2.4.1</version>
</dependency>"><pre class="notranslate"><code><dependency>
<groupId>au.com.codeka</groupId>
<artifactId>carrot</artifactId>
<version>2.4.1</version>
</dependency>
</code></pre></div>
<p>With Gradle:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="compile 'au.com.codeka:carrot:2.4.1'"><pre class="notranslate"><code>compile 'au.com.codeka:carrot:2.4.1'
</code></pre></div>codekatag:github.com,2008:Repository/25750754/v2.4.02017-08-22T12:13:50Zv2.4.0<p>Lots of refactoring in this release, but also some new features.</p>
<ul>
<li>New <code>{% include %}</code> tag, for doing simple includes.</li>
<li>The <code>CarrotEngine</code> class is now immutable, and you can use a Builder to construct it.</li>
<li>You can use <code>{% for key, value in map %}</code> to iterate the key/value pairs of a map.</li>
<li>The <code>{% set %}</code> tag supports setting simple values, as well as blocks (via <code>{% set name = value %}</code>).</li>
</ul>
<p>As with previous releases, the recommended approach for using Carrot is via Maven or Gradle:</p>
<p>With Maven:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="<dependency>
<groupId>au.com.codeka</groupId>
<artifactId>carrot</artifactId>
<version>2.4.0</version>
</dependency>"><pre class="notranslate"><code><dependency>
<groupId>au.com.codeka</groupId>
<artifactId>carrot</artifactId>
<version>2.4.0</version>
</dependency>
</code></pre></div>
<p>With Gradle:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="compile 'au.com.codeka:carrot:2.4.0'"><pre class="notranslate"><code>compile 'au.com.codeka:carrot:2.4.0'
</code></pre></div>codekatag:github.com,2008:Repository/25750754/v2.3.02017-08-22T11:39:51Zv2.3.0<p>Maintenance release, with two main changes:</p>
<ul>
<li>A dedicated Bindings interface, so bindings can be implemented from any class, not just a map.</li>
<li>Android support by reverting some features to Java 7</li>
</ul>
<p>As with previous releases, the recommended approach for using Carrot is via Maven or Gradle:</p>
<p>With Maven:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="<dependency>
<groupId>au.com.codeka</groupId>
<artifactId>carrot</artifactId>
<version>2.3.0</version>
</dependency>"><pre class="notranslate"><code><dependency>
<groupId>au.com.codeka</groupId>
<artifactId>carrot</artifactId>
<version>2.3.0</version>
</dependency>
</code></pre></div>
<p>With Gradle:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="compile 'au.com.codeka:carrot:2.3.0'"><pre class="notranslate"><code>compile 'au.com.codeka:carrot:2.3.0'
</code></pre></div>codekatag:github.com,2008:Repository/25750754/v2.2.02017-03-15T12:57:17Zv2.2.0<h2>Features this release:</h2>
<ul>
<li><a href="https://codeka.github.io/carrot/tags/set.html" rel="nofollow">Set tag</a></li>
<li>Proper HTML-escaping, and some <a href="https://codeka.github.io/carrot/helpers.html#html_safe" rel="nofollow">helpers</a> to work with HTML-escaping.</li>
</ul>
<p>As with previous releases, the recommended approach for using Carrot is via Maven or Gradle:</p>
<p><em>With Maven:</em></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="<dependency>
<groupId>au.com.codeka</groupId>
<artifactId>carrot</artifactId>
<version>2.2.0</version>
</dependency>"><pre class="notranslate"><code><dependency>
<groupId>au.com.codeka</groupId>
<artifactId>carrot</artifactId>
<version>2.2.0</version>
</dependency>
</code></pre></div>
<p><em>With Gradle:</em></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="compile 'au.com.codeka:carrot:2.2.0'"><pre class="notranslate"><code>compile 'au.com.codeka:carrot:2.2.0'
</code></pre></div>codekatag:github.com,2008:Repository/25750754/v2.1.02017-03-15T10:29:27Zv2.1.0<p>This is the first release published here on GitHub, for complete documentation see <a href="https://codeka.github.io/carrot/" rel="nofollow">here</a>.</p>codeka