trackler 2.2.1.146 → 2.2.1.147
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/trackler/version.rb +1 -1
- data/tracks/elm/README.md +50 -0
- data/tracks/elm/bin/stub-new-exercise +38 -0
- data/tracks/elm/template/Exercise.elm.template +5 -0
- data/tracks/elm/template/Exercise.example.elm.template +5 -0
- data/tracks/elm/template/elm-package.json +14 -0
- data/tracks/elm/template/tests/Tests.elm.template +11 -0
- data/tracks/elm/template/tests/elm-package.json +16 -0
- data/tracks/rust/exercises/armstrong-numbers/README.md +1 -1
- data/tracks/rust/exercises/diamond/example.rs +1 -3
- data/tracks/scheme/config.json +8 -0
- data/tracks/scheme/exercises/two-fer/README.md +10 -0
- data/tracks/scheme/exercises/two-fer/example.scm +7 -0
- data/tracks/scheme/exercises/two-fer/two-fer-test.scm +25 -0
- data/tracks/scheme/exercises/two-fer/two-fer.scm +2 -0
- metadata +12 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b61403722ebdf8586671cb971ce56257a201f438
|
4
|
+
data.tar.gz: 6d88b07bc32fe0c6cd7546ac894e3d2501f68c3a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e10daad4a8cc476dcb11910133aee8d6b1fe49f9ab9cedf939ea94403485490235d8d0189b1cb9de5985490cad689cbf23b08635602306cceacad81e88844bd
|
7
|
+
data.tar.gz: 4816d57cb9b60dbe25df9356929ff8b26973dd5c74f6b527c804b48251c6fb297ffc51d3c5c9e9a6f94dcabdc6bab1d45423fdce595717c041cddb30ccaf7031
|
data/lib/trackler/version.rb
CHANGED
data/tracks/elm/README.md
CHANGED
@@ -85,6 +85,56 @@ Please keep the following in mind:
|
|
85
85
|
|
86
86
|
- If you are submitting a new exercise, be sure to add it to the appropriate place in the `config.json` file. Also, please run `bin/fetch-configlet && bin/configlet` to ensure the exercise is configured correctly.
|
87
87
|
|
88
|
+
### Generating Setup
|
89
|
+
|
90
|
+
To make implementing a new exercise a little bit easier, a new script was added
|
91
|
+
to the `bin` folder. Running `bin/stub-new-exercise <exercise-slug>` will setup
|
92
|
+
the exercise folder and then re-direct you back to this section of the README to
|
93
|
+
do the next steps.
|
94
|
+
|
95
|
+
The next steps after generating the files include
|
96
|
+
|
97
|
+
1. Run `bin/configlet uuid` to generate a UUID for placing in `config.json`
|
98
|
+
2. Add the exercise configuration to `config.json`, replacing the placeholders
|
99
|
+
with the exercise specific information
|
100
|
+
```json
|
101
|
+
{
|
102
|
+
"core": false,
|
103
|
+
"difficulty": 1,
|
104
|
+
"slug": "<exercise-slug",
|
105
|
+
"topics": null,
|
106
|
+
"unlocked_by": null,
|
107
|
+
"uuid": "<generated-uuid>"
|
108
|
+
}
|
109
|
+
```
|
110
|
+
**Note**: Each exercise configuration will be different by potentially more than
|
111
|
+
the UUID. If you have questions, you can wait until submitting the PR and it can
|
112
|
+
get resolved then.
|
113
|
+
3. The following search shows all the locations in the template files you need
|
114
|
+
to change before renaming them to just `*.elm` files instead of
|
115
|
+
`*.elm.template`.
|
116
|
+
```bash
|
117
|
+
$ grep -r "{exercise}" exercises/<exercise>
|
118
|
+
./Exercise.elm.template:module {exercise} exposing ({method})
|
119
|
+
./Exercise.example.elm.template:module {exercise} exposing ({method})
|
120
|
+
./tests/Tests.elm.template:import {exercise} exposing ({method})
|
121
|
+
./tests/Tests.elm.template: describe "{exercise}"
|
122
|
+
$ grep -r "{function}" exercises/<exercise>
|
123
|
+
./Exercise.elm.template:module {exercise} exposing ({function})
|
124
|
+
./Exercise.elm.template:{function} =
|
125
|
+
./Exercise.example.elm.template:module {exercise} exposing ({function})
|
126
|
+
./Exercise.example.elm.template:{function} =
|
127
|
+
./tests/Tests.elm.template:import {exercise} exposing ({function})
|
128
|
+
```
|
129
|
+
3. The `bin/stub-new-exercise` script has to pull down the
|
130
|
+
`problem-specifications` repo to generate the README. You will also be
|
131
|
+
able to get the canonical test data from that repo in the
|
132
|
+
`exercises/<exercise-slug>/canonical-data.json` file. With the test data, you
|
133
|
+
should have enough to get started with the tests.
|
134
|
+
4. After the tests are written, you can start writing an implementation example
|
135
|
+
in `<exercise>.example.elm`.
|
136
|
+
5. Also remember to stub out the `<exercise>.elm` file, which is what users will
|
137
|
+
get when they run `exercism fetch`.
|
88
138
|
|
89
139
|
### Elm icon
|
90
140
|
We were unable to find copyright information about the Elm logo, nor information about who designed it. Presumably Evan Czaplicki, creator of the Elm language, also made the logo, and holds copyright. It may also fall within the public domain, since it is a geometric shape. We've adapted the official Elm logo by changing the colors, which we believe falls under "fair use".
|
@@ -0,0 +1,38 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
if [ -z $1 ]; then
|
4
|
+
echo "No exercise slug provided"
|
5
|
+
exit 1
|
6
|
+
fi
|
7
|
+
|
8
|
+
tolower() {
|
9
|
+
local result=$(echo $1 | tr '[:upper:]' '[:lower:]')
|
10
|
+
echo "$result"
|
11
|
+
}
|
12
|
+
|
13
|
+
exercise=$(tolower $1)
|
14
|
+
|
15
|
+
if [ -n "$(find exercises -name $exercise -type d -maxdepth 1)" ]; then
|
16
|
+
echo "Exercise '$exercise' already exists"
|
17
|
+
exit 1
|
18
|
+
fi
|
19
|
+
|
20
|
+
if [ -z "$(find bin -name configlet -type f)" ]; then
|
21
|
+
bin/fetch-configlet
|
22
|
+
fi
|
23
|
+
|
24
|
+
if [ -z "$(find .. -name "problem-specifications" -type d -maxdepth 1)" ]; then
|
25
|
+
git clone https://github.com/exercism/problem-specifications.git \
|
26
|
+
../problem-specifications
|
27
|
+
fi
|
28
|
+
|
29
|
+
mkdir -p exercises/$exercise/tests
|
30
|
+
|
31
|
+
bin/configlet generate . --only $exercise
|
32
|
+
|
33
|
+
cp -r template/* exercises/$exercise
|
34
|
+
|
35
|
+
echo "Done"
|
36
|
+
echo "---"
|
37
|
+
echo "Navigate to 'exercises/$exercise' to start working on '$exercise'"
|
38
|
+
echo "See the 'Generating Setup' part of contributing to figure out the next steps"
|
@@ -0,0 +1,14 @@
|
|
1
|
+
{
|
2
|
+
"version": "3.0.0",
|
3
|
+
"summary": "Exercism problems in Elm.",
|
4
|
+
"repository": "https://github.com/exercism/elm.git",
|
5
|
+
"license": "BSD3",
|
6
|
+
"source-directories": [
|
7
|
+
"."
|
8
|
+
],
|
9
|
+
"exposed-modules": [],
|
10
|
+
"dependencies": {
|
11
|
+
"elm-lang/core": "5.0.0 <= v < 6.0.0"
|
12
|
+
},
|
13
|
+
"elm-version": "0.18.0 <= v < 0.19.0"
|
14
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
{
|
2
|
+
"version": "3.0.0",
|
3
|
+
"summary": "Exercism problems in Elm.",
|
4
|
+
"repository": "https://github.com/exercism/elm.git",
|
5
|
+
"license": "BSD3",
|
6
|
+
"source-directories": [
|
7
|
+
".",
|
8
|
+
".."
|
9
|
+
],
|
10
|
+
"exposed-modules": [],
|
11
|
+
"dependencies": {
|
12
|
+
"elm-lang/core": "5.0.0 <= v < 6.0.0",
|
13
|
+
"elm-community/elm-test": "4.0.0 <= v < 5.0.0"
|
14
|
+
},
|
15
|
+
"elm-version": "0.18.0 <= v < 0.19.0"
|
16
|
+
}
|
@@ -5,7 +5,7 @@ An [Armstrong number](https://en.wikipedia.org/wiki/Narcissistic_number) is a nu
|
|
5
5
|
For example:
|
6
6
|
|
7
7
|
- 9 is an Armstrong number, because `9 = 9^1 = 9`
|
8
|
-
- 10 is *not* an Armstrong number, because `10 != 1^2 + 0^2 =
|
8
|
+
- 10 is *not* an Armstrong number, because `10 != 1^2 + 0^2 = 1`
|
9
9
|
- 153 is an Armstrong number, because: `153 = 1^3 + 5^3 + 3^3 = 1 + 125 + 27 = 153`
|
10
10
|
- 154 is *not* an Armstrong number, because: `154 != 1^3 + 5^3 + 4^3 = 1 + 125 + 64 = 190`
|
11
11
|
|
@@ -1,9 +1,8 @@
|
|
1
1
|
static ABC: &'static str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
2
|
-
use std::ascii::AsciiExt;
|
3
2
|
|
4
3
|
pub fn get_diamond(diamond_char: char) -> Vec<String> {
|
5
4
|
let mut result: Vec<String> = Vec::new();
|
6
|
-
let diamond_char =
|
5
|
+
let diamond_char = diamond_char.to_ascii_uppercase();
|
7
6
|
if ABC.find(diamond_char).is_none() {
|
8
7
|
return result;
|
9
8
|
}
|
@@ -24,7 +23,6 @@ pub fn get_diamond(diamond_char: char) -> Vec<String> {
|
|
24
23
|
rev.pop(); //remove middle pice to avoid duplicates
|
25
24
|
for line in rev.drain(..).rev() {
|
26
25
|
result.push(line);
|
27
|
-
|
28
26
|
}
|
29
27
|
|
30
28
|
result
|
data/tracks/scheme/config.json
CHANGED
@@ -120,6 +120,14 @@
|
|
120
120
|
"topics": null,
|
121
121
|
"unlocked_by": null,
|
122
122
|
"uuid": "9460b65d-dc80-4a95-8782-b395d2cc979e"
|
123
|
+
},
|
124
|
+
{
|
125
|
+
"core": false,
|
126
|
+
"difficulty": 1,
|
127
|
+
"slug": "two-fer",
|
128
|
+
"topics": null,
|
129
|
+
"unlocked_by": null,
|
130
|
+
"uuid": "3ecc2d1c-55e0-45c9-ba35-57d7d8cfd51e"
|
123
131
|
}
|
124
132
|
],
|
125
133
|
"foregone": [],
|
@@ -0,0 +1,10 @@
|
|
1
|
+
`Two-fer` or `2-fer` is short for two for one. One for you and one for me.
|
2
|
+
|
3
|
+
```text
|
4
|
+
"One for X, one for me."
|
5
|
+
```
|
6
|
+
|
7
|
+
When X is a name or "you".
|
8
|
+
|
9
|
+
If the given name is "Alice", the result should be "One for Alice, one for me."
|
10
|
+
If no name is given, the result should be "One for you, one for me."
|
@@ -0,0 +1,25 @@
|
|
1
|
+
;; Load SRFI-64 lightweight testing specification
|
2
|
+
(use-modules (srfi srfi-64))
|
3
|
+
|
4
|
+
;; Suppress log file output. To write logs, comment out the following line:
|
5
|
+
(module-define! (resolve-module '(srfi srfi-64)) 'test-log-to-file #f)
|
6
|
+
|
7
|
+
;; Require module
|
8
|
+
(add-to-load-path (dirname (current-filename)))
|
9
|
+
(use-modules (two-fer))
|
10
|
+
|
11
|
+
(test-begin "two-fer")
|
12
|
+
|
13
|
+
(test-assert "no name given"
|
14
|
+
(equal? (two-fer)
|
15
|
+
"One for you, one for me."))
|
16
|
+
|
17
|
+
(test-assert "a name given"
|
18
|
+
(equal? (two-fer "Alice")
|
19
|
+
"One for Alice, one for me."))
|
20
|
+
|
21
|
+
(test-assert "another name given"
|
22
|
+
(equal? (two-fer "Bob")
|
23
|
+
"One for Bob, one for me."))
|
24
|
+
|
25
|
+
(test-end "two-fer")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trackler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.1.
|
4
|
+
version: 2.2.1.147
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Katrina Owen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05-
|
11
|
+
date: 2018-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubyzip
|
@@ -4558,6 +4558,7 @@ files:
|
|
4558
4558
|
- tracks/elm/bin/build.sh
|
4559
4559
|
- tracks/elm/bin/fetch-configlet
|
4560
4560
|
- tracks/elm/bin/install-elm-format
|
4561
|
+
- tracks/elm/bin/stub-new-exercise
|
4561
4562
|
- tracks/elm/config.json
|
4562
4563
|
- tracks/elm/config/exercise_readme.go.tmpl
|
4563
4564
|
- tracks/elm/config/maintainers.json
|
@@ -4818,6 +4819,11 @@ files:
|
|
4818
4819
|
- tracks/elm/img/icon.png
|
4819
4820
|
- tracks/elm/package-lock.json
|
4820
4821
|
- tracks/elm/package.json
|
4822
|
+
- tracks/elm/template/Exercise.elm.template
|
4823
|
+
- tracks/elm/template/Exercise.example.elm.template
|
4824
|
+
- tracks/elm/template/elm-package.json
|
4825
|
+
- tracks/elm/template/tests/Tests.elm.template
|
4826
|
+
- tracks/elm/template/tests/elm-package.json
|
4821
4827
|
- tracks/erlang/.git
|
4822
4828
|
- tracks/erlang/.github/stale.yml
|
4823
4829
|
- tracks/erlang/.gitignore
|
@@ -14062,6 +14068,10 @@ files:
|
|
14062
14068
|
- tracks/scheme/exercises/scrabble-score/example.scm
|
14063
14069
|
- tracks/scheme/exercises/scrabble-score/scrabble-score-test.scm
|
14064
14070
|
- tracks/scheme/exercises/scrabble-score/scrabble-score.scm
|
14071
|
+
- tracks/scheme/exercises/two-fer/README.md
|
14072
|
+
- tracks/scheme/exercises/two-fer/example.scm
|
14073
|
+
- tracks/scheme/exercises/two-fer/two-fer-test.scm
|
14074
|
+
- tracks/scheme/exercises/two-fer/two-fer.scm
|
14065
14075
|
- tracks/scheme/exercises/word-count/README.md
|
14066
14076
|
- tracks/scheme/exercises/word-count/example.scm
|
14067
14077
|
- tracks/scheme/exercises/word-count/word-count-test.scm
|