diff --git a/.travis.yml b/.travis.yml index ad10645..967eb58 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,8 +7,7 @@ sudo: false install: - nvm install 6 - nvm use 6 - - npm install -g elm@0.17.1 elm-test@0.17.3 - - elm package install -y + - npm install - bin/install-elm-format linux - export PATH=$PATH:$PWD/bin @@ -19,4 +18,5 @@ script: cache: directories: - - elm-stuff + - node_modules + - elm-stuff diff --git a/bin/build.sh b/bin/build.sh index 6a84349..53b5eee 100755 --- a/bin/build.sh +++ b/bin/build.sh @@ -12,7 +12,7 @@ if [ $? -ne 0 ]; then exit 1 fi -elm-format --yes --validate exercises/**/*{.example,Tests.elm} +elm-format --yes --validate exercises/**/{*.example.elm,Tests.elm} if [ $? -ne 0 ]; then echo "*******************************************************************" @@ -33,19 +33,19 @@ fi declare -i TEST_RESULT=0 FAILED_EXERCISES='' -for example_file in exercises/**/*.example +for example_file in exercises/**/*.example.elm do exercise_dir=$(dirname $example_file) - exercise=$(basename $example_file .example) - mv "$exercise_dir/$exercise.elm" "$exercise_dir/$exercise.impl" - mv "$exercise_dir/$exercise.example" "$exercise_dir/$exercise.elm" + exercise_name=$(basename $example_file .example.elm) + mv "$exercise_dir/$exercise_name.elm" "$exercise_dir/$exercise_name.impl" + mv "$exercise_dir/$exercise_name.example.elm" "$exercise_dir/$exercise_name.elm" echo '-------------------------------------------------------' echo "Testing $exercise" # prevent elm-test from installing dependencies mv $exercise_dir/elm-package.json $exercise_dir/elm-package.json.disabled - elm-test $exercise_dir/*Tests.elm + npm test -- $exercise_dir/Tests.elm # capture result from last command (elm-test) if [ $? -ne 0 ]; then @@ -55,8 +55,8 @@ do # be kind, rewind mv $exercise_dir/elm-package.json.disabled $exercise_dir/elm-package.json - mv "$exercise_dir/$exercise.elm" "$exercise_dir/$exercise.example" - mv "$exercise_dir/$exercise.impl" "$exercise_dir/$exercise.elm" + mv "$exercise_dir/$exercise_name.elm" "$exercise_dir/$exercise_name.example.elm" + mv "$exercise_dir/$exercise_name.impl" "$exercise_dir/$exercise_name.elm" done if [ $TEST_RESULT -ne 0 ]; then diff --git a/bin/install-elm-format b/bin/install-elm-format index b5a7bb2..553e74f 100755 --- a/bin/install-elm-format +++ b/bin/install-elm-format @@ -12,7 +12,7 @@ case $(uname) in echo "linux";; esac) -URL=https://github.com/avh4/elm-format/releases/download/0.4.0-alpha/elm-format-0.17-0.4.0-alpha-$OS-x64.tgz +URL=https://github.com/avh4/elm-format/releases/download/0.5.2-alpha/elm-format-0.18-0.5.2-alpha-$OS-x64.tgz curl -L $URL | tar -xvzO > bin/elm-format diff --git a/elm-package.json b/elm-package.json index 36eec37..1366765 100644 --- a/elm-package.json +++ b/elm-package.json @@ -1,5 +1,5 @@ { - "version": "2.0.0", + "version": "3.0.0", "summary": "Exercism problems in Elm.", "repository": "https://github.com/exercism/xelm.git", "license": "BSD3", @@ -38,9 +38,9 @@ ], "exposed-modules": [], "dependencies": { - "elm-lang/core": "4.0.0 <= v < 5.0.0", - "elm-community/elm-test": "2.0.0 <= v < 3.0.0", - "rtfeldman/node-test-runner": "2.0.0 <= v < 3.0.0" + "elm-lang/core": "5.0.0 <= v < 6.0.0", + "elm-community/elm-test": "3.0.0 <= v < 4.0.0", + "rtfeldman/node-test-runner": "3.0.0 <= v < 4.0.0" }, - "elm-version": "0.17.0 <= v < 0.18.0" + "elm-version": "0.18.0 <= v < 0.19.0" } diff --git a/exercises/hello-world/HelloWorld.elm b/exercises/hello-world/HelloWorld.elm index 731e3fb..a9ff62d 100644 --- a/exercises/hello-world/HelloWorld.elm +++ b/exercises/hello-world/HelloWorld.elm @@ -1,9 +1,9 @@ {- -This is a "stub" file. It's a little start on your solution. It's not a -complete solution though; you have to write some code. + This is a "stub" file. It's a little start on your solution. It's not a + complete solution though; you have to write some code. -The module name is expected by the test program and must match the name of this -file. It has to stay just the way it is. + The module name is expected by the test program and must match the name of this + file. It has to stay just the way it is. -} @@ -14,12 +14,12 @@ module HelloWorld exposing (..) helloWorld : Maybe String -> String helloWorld name = - "replace with your code!" + "replace with your code!" {- -When you have a working solution, REMOVE ALL THE STOCK COMMENTS. -They're here to help you get started but they only clutter a finished solution. -If you leave them in, nitpickers will protest! + When you have a working solution, REMOVE ALL THE STOCK COMMENTS. + They're here to help you get started but they only clutter a finished solution. + If you leave them in, nitpickers will protest! -} diff --git a/exercises/hello-world/Example.elm b/exercises/hello-world/HelloWorld.example.elm similarity index 100% rename from exercises/hello-world/Example.elm rename to exercises/hello-world/HelloWorld.example.elm diff --git a/exercises/hello-world/package.json b/exercises/hello-world/package.json index 9277666..38377a9 100644 --- a/exercises/hello-world/package.json +++ b/exercises/hello-world/package.json @@ -1,10 +1,13 @@ { - "scripts": { - "postinstall": "elm package install -y", - "test": "elm-test Tests.elm" - }, - "dependencies": { - "elm": "^0.18.0", - "elm-test": "^0.18.0" - } + "description": "Excercism/Elm", + "repository": "https://github.com/exercism/xelm.git", + "license": "MIT", + "scripts": { + "postinstall": "elm-package install -y", + "test": "elm-test Tests.elm" + }, + "dependencies": { + "elm": "^0.18.0", + "elm-test": "^0.18.0" + } } diff --git a/package.json b/package.json new file mode 100644 index 0000000..6dac68c --- /dev/null +++ b/package.json @@ -0,0 +1,10 @@ +{ + "scripts": { + "postinstall": "elm package install -y", + "test": "elm-test" + }, + "dependencies": { + "elm": "^0.18.0", + "elm-test": "^0.18.0" + } +}