Skip to content

Commit e541c74

Browse files
committed
#9 shorter names
1 parent 5010b46 commit e541c74

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

src/main/java/org/eolang/jucs/JucsProvider.java

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -66,27 +66,16 @@ public void accept(final ClasspathSource ant) {
6666
@Override
6767
public Stream<? extends Arguments> provideArguments(
6868
final ExtensionContext ctx) {
69-
return this.yamls("")
70-
.stream()
71-
.map(
72-
p -> Arguments.of(
73-
Named.of(
74-
p,
75-
new UncheckedText(
76-
new TextOf(new ResourceOf(p))
77-
).asString()
78-
)
79-
)
80-
);
69+
return this.yamls("").stream();
8170
}
8271

8372
/**
8473
* Find all YAMLs recursively on classpath.
8574
* @param prefix Prefix (empty when it starts)
8675
* @return The list of full paths
8776
*/
88-
private Collection<String> yamls(final String prefix) {
89-
final Collection<String> out = new LinkedList<>();
77+
private Collection<Arguments> yamls(final String prefix) {
78+
final Collection<Arguments> out = new LinkedList<>();
9079
final String home = String.format("%s/%s", this.sanitized(), prefix);
9180
final String folder = new UncheckedText(
9281
new TextOf(new ResourceOf(home))
@@ -98,7 +87,20 @@ private Collection<String> yamls(final String prefix) {
9887
for (final String sub : subs) {
9988
final Path path = Paths.get(String.format("%s%s", prefix, sub));
10089
if (matcher.matches(path)) {
101-
out.add(String.format("%s%s", home, sub));
90+
out.add(
91+
Arguments.of(
92+
Named.of(
93+
path.toString(),
94+
new UncheckedText(
95+
new TextOf(
96+
new ResourceOf(
97+
String.format("%s%s", home, sub)
98+
)
99+
)
100+
).asString()
101+
)
102+
)
103+
);
102104
} else if (!JucsProvider.IS_FILE.matcher(sub).matches()) {
103105
out.addAll(this.yamls(String.format("%s/", sub)));
104106
}

0 commit comments

Comments
 (0)