Skip to content

Commit 6df4c97

Browse files
committed
chore: reverse list for eachUrlPart
1 parent dabfd38 commit 6df4c97

File tree

5 files changed

+8
-15
lines changed

5 files changed

+8
-15
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,7 @@ Some [helpers](/src/main/java/se/bjurr/gitchangelog/api/helpers) are implemented
167167
Loop each part of the URL.
168168

169169
```hbs
170-
{{#eachUrlPart .}}
171-
{{@index}}: {{.}}
172-
{{/eachUrlPart}}
170+
https://gitlab.com/{{#eachUrlPart .}}{{#if @first}}{{else}}{{.}}/{{/if}}{{/eachUrlPart}}
173171
```
174172

175173
### `ifReleaseTag <Tag>`

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
2-
#Sat Jan 18 07:59:25 CET 2025
2+
#Sat Jan 25 19:50:49 CST 2025
33
description='Library for parsing report files from static code analysis'
44
group=se.bjurr.gitchangelog
55
sourceCompatibility=17
66
targetCompatibility=17
7-
version=2.5.0
7+
version=2.5.1

src/main/java/se/bjurr/gitchangelog/api/helpers/Helpers.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import com.github.jknack.handlebars.Options.Buffer;
2929
import com.github.jknack.handlebars.helper.EachHelper;
3030
import java.io.IOException;
31+
import java.util.Collections;
3132
import java.util.List;
3233
import java.util.Map;
3334
import java.util.TreeMap;
@@ -242,6 +243,7 @@ public static Map<String, Helper<?>> getAll() {
242243
helpers.put(
243244
"eachUrlPart",
244245
(final Changelog changelog, final Options options) -> {
246+
Collections.reverse(changelog.getUrlParts());
245247
return each(options, changelog.getUrlParts());
246248
});
247249
return helpers;

src/test/java/se/bjurr/gitchangelog/api/TemplatesTest.testEachUrlPart.approved.txt

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ template:
33
ownerName: {{ownerName}}
44
repoName: {{repoName}}
55
urlParts: {{urlParts}}
6-
{{#eachUrlPart .}}
7-
{{@index}}: {{.}}
8-
{{/eachUrlPart}}
6+
https://github.com/{{#eachUrlPart .}}{{#if @first}}{{else}}{{.}}/{{/if}}{{/eachUrlPart}}
97

108
---------------------------------------------
119

@@ -72,10 +70,7 @@ changelog:
7270
ownerName: tomasbjerre
7371
repoName: git-changelog-lib
7472
urlParts: [git-changelog-lib, tomasbjerre, git@github.com]
75-
0: git-changelog-lib
76-
1: tomasbjerre
77-
2: git@github.com
78-
73+
https://github.com/tomasbjerre/git-changelog-lib/
7974

8075
---------------------------------------------
8176

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
ownerName: {{ownerName}}
22
repoName: {{repoName}}
33
urlParts: {{urlParts}}
4-
{{#eachUrlPart .}}
5-
{{@index}}: {{.}}
6-
{{/eachUrlPart}}
4+
https://github.com/{{#eachUrlPart .}}{{#if @first}}{{else}}{{.}}/{{/if}}{{/eachUrlPart}}

0 commit comments

Comments
 (0)