Skip to content

Commit

Permalink
refactor: Increment version and minor refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
danielptv committed May 19, 2023
1 parent b41d6a6 commit fd296b5
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 13 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
}

group = "com.danielptv"
version = "2.0.0"
version = "2.1.0"

java {
toolchain {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/danielptv/simplex/dev/Banner.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
public final class Banner {
public static final String TEXT = """
%s
Version v2.0.0
Version v2.1.0
Author %s
GitHub %s
"""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
package com.danielptv.simplex.dev;

import com.danielptv.simplex.shell.PromptColor;
import com.danielptv.simplex.shell.OutputHelper;
import org.jline.terminal.Terminal;
import org.jline.utils.AttributedString;
import org.jline.utils.AttributedStyle;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;
import org.springframework.shell.jline.PromptProvider;

@Configuration
Expand All @@ -19,9 +15,4 @@ public final AttributedString getPrompt() {
AttributedStyle.DEFAULT.foreground(PromptColor.YELLOW.toJlineAttributedStyle())
);
}

@Bean
OutputHelper shellHelper(@Lazy final Terminal terminal) {
return new OutputHelper(terminal);
}
}
2 changes: 2 additions & 0 deletions src/main/java/com/danielptv/simplex/shell/OutputHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
import org.jline.utils.AttributedStringBuilder;
import org.jline.utils.AttributedStyle;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@RequiredArgsConstructor
@SuppressFBWarnings("EI_EXPOSE_REP2")
@Component
public class OutputHelper {
@Value("${shell.out.info}")
private String infoColor;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/danielptv/simplex/shell/SimplexInput.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ private boolean checkFunction(final String input, final SimplexInputContext cont
}
if (!input.matches(standardPattern) && isObjFunction ||
!input.matches(standardPattern) && !input.matches(relSignPattern)) {
inputResult.setRepresentation("Invalid function");
context.setMessage("Invalid function", MessageLevel.ERROR);
inputResult.setRepresentation("Invalid input");
context.setMessage("Invalid input", MessageLevel.ERROR);
return false;
} else {
final var current = buildCurrent(input);
Expand Down

0 comments on commit fd296b5

Please sign in to comment.