Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions bin/journey-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ get_operating_system() {
echo "linux";;
(Windows*)
echo "windows";;
(MINGW*)
echo "windows";;
(*)
echo "linux";;
esac
Expand Down Expand Up @@ -102,10 +104,25 @@ download_exercism_cli() {
# "curl..." :: HTTP 302 headers, including "Location" -- URL to redirect to.
# "awk..." :: pluck last path segment from "Location" (i.e. the version number)
local version="$(curl --head --silent ${latest} | awk -v FS=/ '/Location:/{print $NF}' | tr -d '\r')"
local download_url=${CLI_RELEASES}/download/${version}/exercism-${os}-${arch}.tgz

local download_url_suffix
local unzip_command
local unzip_from_file_option
if [[ ${os} == "windows" ]] ; then
download_url_suffix="zip"
unzip_command="unzip -d"
unzip_from_file_option=""
else
download_url_suffix="tgz"
unzip_command="tar xz -C"
unzip_from_file_option="-f"
fi
local download_url=${CLI_RELEASES}/download/${version}/exercism-${os}-${arch}.${download_url_suffix}

mkdir -p ${exercism_home}
curl -s --location ${download_url} | tar xz -C ${exercism_home}
local temp=`mktemp`
curl -s --location ${download_url} > ${temp}
${unzip_command} ${exercism_home} ${unzip_from_file_option} ${temp}
echo "<<< download_exercism_cli()"
}

Expand Down Expand Up @@ -192,8 +209,8 @@ solve_all_exercises() {

local xjava=$( pwd )
local exercism_cli="./exercism --config ${exercism_configfile}"
local exercises=`cat config.json | jq '.problems []' --raw-output`
local total_exercises=`cat config.json | jq '.problems | length'`
local exercises=`cat config.json | jq '.exercises[].slug + " "' --join-output`
local total_exercises=`cat config.json | jq '.exercises | length'`
local current_exercise_number=1
local tempfile="${TMPDIR:-/tmp}/journey-test.sh-unignore_all_tests.txt"

Expand Down
1 change: 0 additions & 1 deletion exercises/allergies/src/example/java/Allergen.java

This file was deleted.

20 changes: 20 additions & 0 deletions exercises/allergies/src/example/java/Allergen.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
public enum Allergen {
EGGS(1),
PEANUTS(2),
SHELLFISH(4),
STRAWBERRIES(8),
TOMATOES(16),
CHOCOLATE(32),
POLLEN(64),
CATS(128);

private final int score;

Allergen(int score) {
this.score = score;
}

public int getScore() {
return score;
}
}
1 change: 0 additions & 1 deletion exercises/meetup/src/example/java/MeetupSchedule.java

This file was deleted.

8 changes: 8 additions & 0 deletions exercises/meetup/src/example/java/MeetupSchedule.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
public enum MeetupSchedule {
FIRST,
SECOND,
THIRD,
FOURTH,
LAST,
TEENTH
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
enum Classification {

DEFICIENT, PERFECT, ABUNDANT

}

This file was deleted.

29 changes: 29 additions & 0 deletions exercises/robot-simulator/src/example/java/GridPosition.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
final class GridPosition {

final int x;

final int y;

GridPosition(final int x, final int y) {
this.x = x;
this.y = y;
}

/*
* This equals method is of deliberately narrow scope (only allows comparison with another GridPosition) to increase
* readability. In general, one should provide a full implementation of Object.equals(Object obj) and a
* corresponding implementation of Object.hashCode(). See
*
* https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html#equals(java.lang.Object)
*
* and
*
* https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html#hashCode()
*
* for more information.
*/
boolean equals(final GridPosition gridPosition) {
return this.x == gridPosition.x && this.y == gridPosition.y;
}

}

This file was deleted.

5 changes: 5 additions & 0 deletions exercises/robot-simulator/src/example/java/Orientation.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
enum Orientation {

NORTH, EAST, SOUTH, WEST

}
1 change: 0 additions & 1 deletion exercises/secret-handshake/src/example/java/Signal.java

This file was deleted.

5 changes: 5 additions & 0 deletions exercises/secret-handshake/src/example/java/Signal.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
enum Signal {

WINK, DOUBLE_BLINK, CLOSE_YOUR_EYES, JUMP

}
1 change: 0 additions & 1 deletion exercises/sublist/src/example/java/Relationship.java

This file was deleted.

5 changes: 5 additions & 0 deletions exercises/sublist/src/example/java/Relationship.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
enum Relationship {

EQUAL, SUBLIST, SUPERLIST, UNEQUAL

}
1 change: 0 additions & 1 deletion exercises/triangle/src/example/java/TriangleException.java

This file was deleted.

5 changes: 5 additions & 0 deletions exercises/triangle/src/example/java/TriangleException.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
public class TriangleException extends Exception {

public TriangleException() {
}
}
1 change: 0 additions & 1 deletion exercises/triangle/src/example/java/TriangleKind.java

This file was deleted.

5 changes: 5 additions & 0 deletions exercises/triangle/src/example/java/TriangleKind.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
public enum TriangleKind {
EQUILATERAL,
ISOSCELES,
SCALENE
}