Skip to content

Commit

Permalink
balloons work better than the old spinner
Browse files Browse the repository at this point in the history
  • Loading branch information
jurgenvinju committed Apr 4, 2024
1 parent 920e33f commit d3a1066
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/org/rascalmpl/repl/TerminalProgressBarMonitor.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,14 @@ private class ProgressBar {
private final Instant startTime;
private Duration duration;
private String message = "";

Check warning on line 140 in src/org/rascalmpl/repl/TerminalProgressBarMonitor.java

View check run for this annotation

Codecov / codecov/patch

src/org/rascalmpl/repl/TerminalProgressBarMonitor.java#L140

Added line #L140 was not covered by tests

/**
* Stepper is incremented with every jobStep that has an visible effect on the progress bar.
* It is used to index into `clocks` or `twister` to create an animation effect.
*/
private int stepper = 1;
private final String[] clocks = new String[] {"🕐" , "🕑", "🕒", "🕓", "🕔", "🕕", "🕖", "🕗", "🕘", "🕙", "🕛"};
private final String[] twister = new String[] {"|" , "/", "-", "\\", "|", "/", "-", "\\"};
private final String[] twister = new String[] {"." , ".", "o", "o", "O","O", "O", "o", "o", ".", "."};
public int nesting = 0;

Check warning on line 149 in src/org/rascalmpl/repl/TerminalProgressBarMonitor.java

View check run for this annotation

Codecov / codecov/patch

src/org/rascalmpl/repl/TerminalProgressBarMonitor.java#L146-L149

Added lines #L146 - L149 were not covered by tests

ProgressBar(String name, int max) {
Expand All @@ -154,7 +159,7 @@ private class ProgressBar {
}

Check warning on line 159 in src/org/rascalmpl/repl/TerminalProgressBarMonitor.java

View check run for this annotation

Codecov / codecov/patch

src/org/rascalmpl/repl/TerminalProgressBarMonitor.java#L151-L159

Added lines #L151 - L159 were not covered by tests

void worked(int amount, String message) {
this.current += Math.min(amount, max);
this.current = Math.min(current + amount, max);
this.duration = Duration.between(startTime, Instant.now());
this.message = message;
}

Check warning on line 165 in src/org/rascalmpl/repl/TerminalProgressBarMonitor.java

View check run for this annotation

Codecov / codecov/patch

src/org/rascalmpl/repl/TerminalProgressBarMonitor.java#L162-L165

Added lines #L162 - L165 were not covered by tests
Expand Down

0 comments on commit d3a1066

Please sign in to comment.