Skip to content

Commit

Permalink
add little more TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
stCarolas committed Feb 19, 2020
1 parent 642a9bc commit 5d1cead
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .github/config.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
todo:
keyword: "TODO"
autoAssign: false
label: false
reopenClosed: true
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void run() {
)

.onEmpty(() -> log.error("no repository provided at all"))
.peek( repo -> log.info("calling repository handlers") )
.peek(repo -> log.info("calling repository handlers") )

.flatMap(
repo -> Option.sequence(this.runHandlersOnRepo(repo))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.github.stcarolas.enki.core.provider;

import static io.vavr.collection.List.empty;
import static io.vavr.control.Option.some;

import java.util.function.Function;
import java.util.function.Supplier;
Expand All @@ -12,6 +13,7 @@
import io.vavr.control.Option;
import lombok.extern.log4j.Log4j2;

// TODO call strategy implementations with safety
@Log4j2
public class StrategiesAsProvider<T extends Repo> implements RepoProvider<T> {
private Option<Supplier<Seq<T>>> repositoriesStrategy;
Expand All @@ -33,7 +35,7 @@ public Option<T> download(T repo) {
.onEmpty(() -> log.info("no DownloadStrategy provided"))
.iterator()
.zip(
Option.of(repo)
some(repo)
.onEmpty(() -> log.error("NULL repo was given to download"))
)
.flatMap(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import io.vavr.control.Option;
import lombok.extern.log4j.Log4j2;

// TODO javadoc for StrategiesAsRepo
@Log4j2
public class StrategiesAsRepo implements Repo {

Expand Down Expand Up @@ -66,6 +67,7 @@ public StrategiesAsRepo setDirectoryStrategy(Supplier<Option<File>> strategy) {
return this;
}

// TODO set StrategiesAsRepo immutable
public StrategiesAsRepo setProvidersStrategy(Supplier<Seq<RepoProvider<? extends Repo>>> strategy) {
this.providersStrategy = some(strategy);
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.github.stcarolas.enki.core.Repo;
import com.github.stcarolas.enki.core.RepoProvider;

import static io.vavr.control.Option.some;
import io.vavr.control.Option;
import io.vavr.control.Try;
import lombok.AccessLevel;
Expand Down Expand Up @@ -36,7 +37,7 @@ public Option<File> get() {
}

private Option<File> constructDirectoryPath(String filename) {
return Option.of(filename)
return some(filename)
.map(it -> new File(TEMPORARY_LOCATION + it));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.function.Supplier;

import static io.vavr.control.Option.none;
import io.vavr.control.Option;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
Expand All @@ -14,7 +15,7 @@ public class NoIdentityStrategy implements Supplier<Option<String>> {
@Override
public Option<String> get() {
log.info("Somebody wants to identify repo with no identity");
return Option.none();
return none();
}

public static Supplier<Option<String>> noIdentity() {
Expand Down

0 comments on commit 5d1cead

Please sign in to comment.