trackler 2.0.7.0 → 2.0.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (209) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/common/exercises/counter/metadata.yml +0 -4
  4. data/common/exercises/error-handling/metadata.yml +0 -4
  5. data/common/exercises/etl/canonical-data.json +1 -1
  6. data/common/exercises/hello-world/canonical-data.json +9 -21
  7. data/common/exercises/hello-world/description.md +7 -42
  8. data/common/exercises/hello-world/metadata.yml +1 -1
  9. data/common/exercises/lens-person/metadata.yml +0 -3
  10. data/common/exercises/luhn/canonical-data.json +17 -17
  11. data/common/exercises/nucleotide-codons/metadata.yml +0 -2
  12. data/common/exercises/react/metadata.yml +0 -2
  13. data/common/exercises/rectangles/metadata.yml +0 -3
  14. data/common/exercises/variable-length-quantity/metadata.yml +0 -2
  15. data/fixtures/tracks/snowflake/config.json +17 -0
  16. data/fixtures/tracks/snowflake/exercises/snowflake-only/description.md +1 -0
  17. data/fixtures/tracks/snowflake/exercises/snowflake-only/metadata.yml +4 -0
  18. data/lib/trackler/description.rb +27 -0
  19. data/lib/trackler/guaranteed_file.rb +77 -0
  20. data/lib/trackler/implementations.rb +5 -5
  21. data/lib/trackler/metadata.rb +27 -0
  22. data/lib/trackler/null_track.rb +22 -0
  23. data/lib/trackler/problem.rb +32 -34
  24. data/lib/trackler/track.rb +1 -1
  25. data/lib/trackler/version.rb +1 -1
  26. data/tracks/csharp/exercises/hello-world/Example.cs +2 -5
  27. data/tracks/csharp/exercises/hello-world/HelloWorldTest.cs +2 -16
  28. data/tracks/elixir/config.json +7 -0
  29. data/tracks/elixir/exercises/series/example.exs +13 -0
  30. data/tracks/elixir/exercises/series/series.exs +11 -0
  31. data/tracks/elixir/exercises/series/series_test.exs +53 -0
  32. data/tracks/erlang/README.md +3 -3
  33. data/tracks/erlang/config.json +15 -11
  34. data/tracks/erlang/exercises/{binary → all-your-base}/include/exercism.hrl +0 -0
  35. data/tracks/erlang/exercises/{binary → all-your-base}/rebar.config +0 -0
  36. data/tracks/erlang/exercises/{trinary/src/trinary.app.src → all-your-base/src/all_your_base.app.src} +2 -2
  37. data/tracks/erlang/exercises/all-your-base/src/example.erl +33 -0
  38. data/tracks/erlang/exercises/all-your-base/test/all_your_base_tests.erl +69 -0
  39. data/tracks/erlang/exercises/hello-world/src/example.erl +4 -4
  40. data/tracks/erlang/exercises/hello-world/test/hello_world_tests.erl +3 -12
  41. data/tracks/erlang/exercises/{trinary → rotational-cipher}/include/exercism.hrl +0 -0
  42. data/tracks/erlang/exercises/{trinary → rotational-cipher}/rebar.config +8 -1
  43. data/tracks/erlang/exercises/rotational-cipher/src/example.erl +19 -0
  44. data/tracks/erlang/exercises/{binary/src/binary.app.src → rotational-cipher/src/rotational_cipher.app.src} +2 -2
  45. data/tracks/erlang/exercises/rotational-cipher/test/rotational_cipher_tests.erl +98 -0
  46. data/tracks/fsharp/exercises/grep/GrepTest.fs +57 -0
  47. data/tracks/fsharp/exercises/hello-world/Example.fs +1 -1
  48. data/tracks/fsharp/exercises/hello-world/HelloWorldTest.fs +2 -12
  49. data/tracks/go/.travis.yml +7 -15
  50. data/tracks/go/exercises/hello-world/example.go +4 -8
  51. data/tracks/go/exercises/hello-world/hello_test.go +20 -16
  52. data/tracks/go/exercises/hello-world/hello_world.go +12 -2
  53. data/tracks/groovy/exercises/hello-world/Example.groovy +2 -2
  54. data/tracks/groovy/exercises/hello-world/HelloWorld.groovy +1 -1
  55. data/tracks/groovy/exercises/hello-world/HelloWorldSpec.groovy +1 -14
  56. data/tracks/haskell/config.json +6 -0
  57. data/tracks/haskell/exercises/hello-world/HINTS.md +6 -0
  58. data/tracks/haskell/exercises/hello-world/examples/success-standard/package.yaml +16 -0
  59. data/tracks/haskell/exercises/hello-world/examples/success-standard/src/HelloWorld.hs +4 -0
  60. data/tracks/haskell/exercises/hello-world/package.yaml +19 -0
  61. data/tracks/haskell/exercises/hello-world/src/HelloWorld.hs +4 -0
  62. data/tracks/haskell/exercises/hello-world/stack.yaml +1 -0
  63. data/tracks/haskell/exercises/hello-world/test/Tests.hs +13 -0
  64. data/tracks/idris/config.json +9 -0
  65. data/tracks/idris/exercises/leap/Leap.ipkg +5 -0
  66. data/tracks/idris/exercises/leap/Makefile +23 -0
  67. data/tracks/idris/exercises/leap/src/Leap.idr +5 -0
  68. data/tracks/idris/exercises/leap/src/Test/Leap.idr +37 -0
  69. data/tracks/idris/exercises/leap/src/example.idr +8 -0
  70. data/tracks/{typescript/exercises → java}/.keep +0 -0
  71. data/tracks/java/config.json +115 -172
  72. data/tracks/java/exercises/anagram/src/test/java/AnagramTest.java +41 -13
  73. data/tracks/java/exercises/list-ops/build.gradle +18 -0
  74. data/tracks/java/exercises/list-ops/src/example/java/ListOps.java +51 -0
  75. data/tracks/java/exercises/list-ops/src/main/java/.keep +0 -0
  76. data/tracks/java/exercises/list-ops/src/test/java/ListOpsTest.java +316 -0
  77. data/tracks/java/exercises/palindrome-products/src/example/java/Palindromes.java +28 -62
  78. data/tracks/java/exercises/palindrome-products/src/test/java/PalindromesTest.java +26 -83
  79. data/tracks/java/exercises/settings.gradle +1 -0
  80. data/tracks/julia/config.json +1 -2
  81. data/tracks/julia/exercises/hello-world/example.jl +2 -2
  82. data/tracks/julia/exercises/hello-world/runtests.jl +1 -6
  83. data/tracks/lua/exercises/TRACK_HINTS.md +8 -0
  84. data/tracks/lua/exercises/hello-world/example.lua +2 -3
  85. data/tracks/lua/exercises/hello-world/hello-world.lua +18 -0
  86. data/tracks/lua/exercises/hello-world/hello-world_spec.lua +6 -12
  87. data/tracks/ocaml/exercises/phone-number/example.ml +8 -18
  88. data/tracks/ocaml/exercises/phone-number/phone_number.mli +1 -7
  89. data/tracks/ocaml/exercises/phone-number/test.ml +24 -23
  90. data/tracks/ocaml/tools/test-generator/src/special_cases.ml +6 -0
  91. data/tracks/ocaml/tools/test-generator/templates/phone-number/template.ml +21 -0
  92. data/tracks/pony/config.json +2 -2
  93. data/tracks/pony/exercises/hello-world/example.pony +1 -2
  94. data/tracks/pony/exercises/hello-world/test.pony +0 -1
  95. data/tracks/rust/config.json +0 -1
  96. data/tracks/rust/exercises/hello-world/example.rs +2 -5
  97. data/tracks/rust/exercises/hello-world/tests/hello-world.rs +2 -14
  98. data/tracks/scala/config.json +11 -2
  99. data/tracks/scala/docs/LEARNING.md +10 -2
  100. data/tracks/scala/docs/RESOURCES.md +0 -1
  101. data/tracks/scala/docs/TESTS.md +10 -6
  102. data/tracks/scala/exercises/rail-fence-cipher/build.sbt +3 -0
  103. data/tracks/scala/exercises/rail-fence-cipher/example.scala +46 -0
  104. data/tracks/scala/exercises/rail-fence-cipher/src/main/scala/RailFenceCipher.scala +0 -0
  105. data/tracks/scala/exercises/rail-fence-cipher/src/test/scala/RailFenceCipherTest.scala +42 -0
  106. data/tracks/scala/testgen/src/main/scala/RailFenceCipherTestGenerator.scala +59 -0
  107. data/tracks/typescript/.gitignore +7 -0
  108. data/tracks/typescript/.travis.yml +18 -1
  109. data/tracks/typescript/Dangerfile +43 -0
  110. data/tracks/typescript/Makefile +57 -0
  111. data/tracks/typescript/README.md +38 -5
  112. data/tracks/typescript/SETUP.md +24 -0
  113. data/tracks/typescript/common/package.json +37 -0
  114. data/tracks/typescript/common/tsconfig.json +21 -0
  115. data/tracks/typescript/common/tslint.json +127 -0
  116. data/tracks/typescript/common/yarn.lock +2697 -0
  117. data/tracks/typescript/config.json +82 -2
  118. data/tracks/typescript/docs/ABOUT.md +1 -0
  119. data/tracks/typescript/docs/INSTALLATION.md +17 -0
  120. data/tracks/typescript/docs/LEARNING.md +8 -0
  121. data/tracks/typescript/docs/RESOURCES.md +7 -0
  122. data/tracks/typescript/docs/TESTS.md +36 -0
  123. data/tracks/typescript/exercises/anagram/anagram.example.ts +23 -0
  124. data/tracks/typescript/exercises/anagram/anagram.test.ts +82 -0
  125. data/tracks/typescript/exercises/anagram/package.json +37 -0
  126. data/tracks/typescript/exercises/anagram/tsconfig.json +21 -0
  127. data/tracks/typescript/exercises/anagram/tslint.json +127 -0
  128. data/tracks/typescript/exercises/anagram/yarn.lock +2697 -0
  129. data/tracks/typescript/exercises/beer-song/beer-song.example.ts +36 -0
  130. data/tracks/typescript/exercises/beer-song/beer-song.test.ts +360 -0
  131. data/tracks/typescript/exercises/beer-song/package.json +37 -0
  132. data/tracks/typescript/exercises/beer-song/tsconfig.json +21 -0
  133. data/tracks/typescript/exercises/beer-song/tslint.json +127 -0
  134. data/tracks/typescript/exercises/beer-song/yarn.lock +2697 -0
  135. data/tracks/typescript/exercises/bob/bob.example.ts +24 -0
  136. data/tracks/typescript/exercises/bob/bob.test.ts +92 -0
  137. data/tracks/typescript/exercises/bob/package.json +37 -0
  138. data/tracks/typescript/exercises/bob/tsconfig.json +21 -0
  139. data/tracks/typescript/exercises/bob/tslint.json +127 -0
  140. data/tracks/typescript/exercises/bob/yarn.lock +2697 -0
  141. data/tracks/typescript/exercises/gigasecond/gigasecond.example.ts +11 -0
  142. data/tracks/typescript/exercises/gigasecond/gigasecond.test.ts +29 -0
  143. data/tracks/typescript/exercises/gigasecond/package.json +37 -0
  144. data/tracks/typescript/exercises/gigasecond/tsconfig.json +21 -0
  145. data/tracks/typescript/exercises/gigasecond/tslint.json +127 -0
  146. data/tracks/typescript/exercises/gigasecond/yarn.lock +2697 -0
  147. data/tracks/typescript/exercises/hamming/hamming.example.ts +19 -0
  148. data/tracks/typescript/exercises/hamming/hamming.test.ts +39 -0
  149. data/tracks/typescript/exercises/hamming/package.json +37 -0
  150. data/tracks/typescript/exercises/hamming/tsconfig.json +21 -0
  151. data/tracks/typescript/exercises/hamming/tslint.json +127 -0
  152. data/tracks/typescript/exercises/hamming/yarn.lock +2697 -0
  153. data/tracks/typescript/exercises/hello-world/hello-world.example.ts +8 -0
  154. data/tracks/typescript/exercises/hello-world/hello-world.test.ts +17 -0
  155. data/tracks/typescript/exercises/hello-world/package.json +37 -0
  156. data/tracks/typescript/exercises/hello-world/tsconfig.json +21 -0
  157. data/tracks/typescript/exercises/hello-world/tslint.json +127 -0
  158. data/tracks/typescript/exercises/hello-world/yarn.lock +2697 -0
  159. data/tracks/typescript/exercises/leap/leap.example.ts +6 -0
  160. data/tracks/typescript/exercises/leap/leap.test.ts +39 -0
  161. data/tracks/typescript/exercises/leap/package.json +37 -0
  162. data/tracks/typescript/exercises/leap/tsconfig.json +21 -0
  163. data/tracks/typescript/exercises/leap/tslint.json +127 -0
  164. data/tracks/typescript/exercises/leap/yarn.lock +2697 -0
  165. data/tracks/typescript/exercises/pangram/package.json +37 -0
  166. data/tracks/typescript/exercises/pangram/pangram.example.ts +32 -0
  167. data/tracks/typescript/exercises/pangram/pangram.test.ts +50 -0
  168. data/tracks/typescript/exercises/pangram/tsconfig.json +21 -0
  169. data/tracks/typescript/exercises/pangram/tslint.json +127 -0
  170. data/tracks/typescript/exercises/pangram/yarn.lock +2697 -0
  171. data/tracks/typescript/exercises/phone-number/package.json +37 -0
  172. data/tracks/typescript/exercises/phone-number/phone-number.example.ts +21 -0
  173. data/tracks/typescript/exercises/phone-number/phone-number.test.ts +55 -0
  174. data/tracks/typescript/exercises/phone-number/tsconfig.json +21 -0
  175. data/tracks/typescript/exercises/phone-number/tslint.json +127 -0
  176. data/tracks/typescript/exercises/phone-number/yarn.lock +2697 -0
  177. data/tracks/typescript/exercises/rna-transcription/package.json +37 -0
  178. data/tracks/typescript/exercises/rna-transcription/rna-transcription.example.ts +13 -0
  179. data/tracks/typescript/exercises/rna-transcription/rna-transcription.test.ts +45 -0
  180. data/tracks/typescript/exercises/rna-transcription/tsconfig.json +21 -0
  181. data/tracks/typescript/exercises/rna-transcription/tslint.json +127 -0
  182. data/tracks/typescript/exercises/rna-transcription/yarn.lock +2697 -0
  183. data/tracks/typescript/exercises/say/package.json +37 -0
  184. data/tracks/typescript/exercises/say/say.example.ts +95 -0
  185. data/tracks/typescript/exercises/say/say.test.ts +78 -0
  186. data/tracks/typescript/exercises/say/tsconfig.json +21 -0
  187. data/tracks/typescript/exercises/say/tslint.json +127 -0
  188. data/tracks/typescript/exercises/say/yarn.lock +2697 -0
  189. data/tracks/typescript/exercises/word-count/package.json +37 -0
  190. data/tracks/typescript/exercises/word-count/tsconfig.json +21 -0
  191. data/tracks/typescript/exercises/word-count/tslint.json +127 -0
  192. data/tracks/typescript/exercises/word-count/word-count.example.ts +16 -0
  193. data/tracks/typescript/exercises/word-count/word-count.test.ts +65 -0
  194. data/tracks/typescript/exercises/word-count/yarn.lock +2697 -0
  195. data/tracks/typescript/exercises/wordy/package.json +37 -0
  196. data/tracks/typescript/exercises/wordy/tsconfig.json +21 -0
  197. data/tracks/typescript/exercises/wordy/tslint.json +127 -0
  198. data/tracks/typescript/exercises/wordy/wordy.example.ts +40 -0
  199. data/tracks/typescript/exercises/wordy/wordy.test.ts +89 -0
  200. data/tracks/typescript/exercises/wordy/yarn.lock +2697 -0
  201. data/tracks/typescript/img/icon.png +0 -0
  202. data/tracks/typescript/img/icon.svg +10 -0
  203. metadata +134 -15
  204. data/tracks/erlang/exercises/binary/src/example.erl +0 -20
  205. data/tracks/erlang/exercises/binary/test/binary_string_tests.erl +0 -26
  206. data/tracks/erlang/exercises/trinary/Makefile +0 -10
  207. data/tracks/erlang/exercises/trinary/src/example.erl +0 -66
  208. data/tracks/erlang/exercises/trinary/test/trinary_tests.erl +0 -36
  209. data/tracks/fsharp/exercises/hello-world/HINTS.md +0 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 32aa25b39ab986b550a5ea333d13b998fb0cbcf4
4
- data.tar.gz: 5262d80d6be0f50a3a9f59614f9d04cbf1e58fb7
3
+ metadata.gz: 31fb33c6f6d2b730536826f3f4636068f82e8fa6
4
+ data.tar.gz: a508d69520c86df66d8d401c138c8416309dee96
5
5
  SHA512:
6
- metadata.gz: 53ef63c74da16dd524573bb94e5c30e45f98dc830bf31679faf52a8a9e5f4d9039d0e77480c7ca4232e168b9ade7e085bf25a2c512649f34079dd3456495cfac
7
- data.tar.gz: 9fb7b89b0eb4449aef8c4c907a38c7315d733ac9e87e014287866e74e5233d7e6363fd79ccdc3f1e4166297c7bee27ac5bc4531a431963e2d557e19f65fc14fd
6
+ metadata.gz: c054cb72f146dad2bbc5d2f1db8b7dd1c5e2d335fc1354036ed49b7f3d59e5ea1a5675e7ed2f543ccd0543acd14edffaf7048ca9a333a55bdf528a8e2d2abb07
7
+ data.tar.gz: 91f5aac573c1b8180254ecf5000ad9d3e297f9731b478149dbd1df2c157ab3119f78b424f5590706a00cc81ee275369c62b2c4489fd847ff5eba5a1efbc48a79
data/CHANGELOG.md CHANGED
@@ -15,6 +15,14 @@ The changelog will not be updated for content updates.
15
15
  ## Next Release
16
16
  * **Your contribution here**
17
17
 
18
+ ## v2.0.8.0 (2017-02-21)
19
+
20
+ * Handle track-specific exercises
21
+
22
+ ## v2.0.7.0 (2017-02-20)
23
+
24
+ * Add Vim script track
25
+
18
26
  ## v2.0.6.0 (2017-01-03)
19
27
 
20
28
  * Deprecate SETUP.md in favor of a new, better-named TRACK_HINTS.md file.
@@ -1,6 +1,2 @@
1
1
  ---
2
2
  blurb: "Design a test suite for a line/letter/character counter tool."
3
- common:
4
- type: focus
5
- special: reverse
6
- deprecated: true
@@ -1,6 +1,2 @@
1
1
  ---
2
2
  blurb: "Implement various kinds of error handling and resource management"
3
- common:
4
- type: focus
5
- go:
6
- topics: ["defer", "errors", "panic"]
@@ -39,8 +39,8 @@
39
39
  },
40
40
  "expected": {
41
41
  "a" : 1,
42
- "e" : 1,
43
42
  "d" : 2,
43
+ "e" : 1,
44
44
  "g" : 2
45
45
  }
46
46
  },
@@ -1,23 +1,11 @@
1
1
  {
2
- "#": [
3
- "Language implementations vary on the issue of missing input variables.",
4
- "In this set of test cases, the input variable is left out of the definition,",
5
- "and the generator would need to handle the language implementation."
6
- ],
7
- "cases": [
8
- {
9
- "description": "no name",
10
- "expected": "Hello, World!"
11
- },
12
- {
13
- "description": "sample name",
14
- "name": "Alice",
15
- "expected": "Hello, Alice!"
16
- },
17
- {
18
- "description": "other sample name",
19
- "name": "Bob",
20
- "expected": "Hello, Bob!"
21
- }
22
- ]
2
+ "exercise":"hello-world",
3
+ "version":"0.1.0",
4
+ "cases":[
5
+ {
6
+ "description":"Say Hi!",
7
+ "property":"hello",
8
+ "expected":"Hello, World!"
9
+ }
10
+ ]
23
11
  }
@@ -1,46 +1,11 @@
1
1
  ["Hello, World!"](http://en.wikipedia.org/wiki/%22Hello,_world!%22_program) is
2
- the traditional first program for beginning programming in a new language.
2
+ the traditional first program for beginning programming in a new language
3
+ or environment.
3
4
 
4
- **Note:** You can skip this exercise by running:
5
+ The objectives are simple:
5
6
 
6
- exercism skip $TRACK_ID hello-world
7
+ - Write a function that says "Hello, World!".
8
+ - Run the test suite and make sure that it succeeds.
9
+ - Submit your solution and check it at the website.
7
10
 
8
- ## Specification
9
-
10
- Write a `Hello World!` function that can greet someone given their name. The
11
- function should return the appropriate greeting.
12
-
13
- For an input of "Alice", the response should be "Hello, Alice!".
14
-
15
- If a name is not given, the response should be "Hello, World!"
16
-
17
- ## Test-Driven Development
18
-
19
- As programmers mature, they eventually want to test their code.
20
-
21
- Here at Exercism we simulate [Test-Driven
22
- Development](http://en.wikipedia.org/wiki/Test-driven_development) (TDD), where
23
- you write your tests before writing any functionality. The simulation comes in
24
- the form of a pre-written test suite, which will signal that you have solved
25
- the problem.
26
-
27
- It will also provide you with a safety net to explore other solutions without
28
- breaking the functionality.
29
-
30
- ### A typical TDD workflow on Exercism:
31
-
32
- 1. Run the test file and pick one test that's failing.
33
- 2. Write some code to fix the test you picked.
34
- 3. Re-run the tests to confirm the test is now passing.
35
- 4. Repeat from step 1.
36
- 5. Submit your solution (`exercism submit /path/to/file`)
37
-
38
- ## Instructions
39
-
40
- Submissions are encouraged to be general, within reason. Having said that, it's
41
- also important not to over-engineer a solution.
42
-
43
- It's important to remember that the goal is to make code as expressive and
44
- readable as we can. However, solutions to the hello-world exercise will not be
45
- reviewed by a person, but by rikki- the robot, who will offer an encouraging
46
- word.
11
+ If everything goes well, you will be ready to fetch your first real exercise.
@@ -1,4 +1,4 @@
1
1
  ---
2
- blurb: 'Greet the user by name, or by saying "Hello, World!" if no name is given.'
2
+ blurb: 'The classical introductory exercise. Just say "Hello, World!"'
3
3
  source: "This is an exercise to introduce users to using Exercism"
4
4
  source_url: "http://en.wikipedia.org/wiki/%22Hello,_world!%22_program"
@@ -1,5 +1,2 @@
1
1
  ---
2
2
  blurb: "Use lenses to update nested records (specific to languages with immutable data)."
3
- common:
4
- type: focus
5
- focus: lenses
@@ -11,18 +11,23 @@
11
11
  "expected": false
12
12
  },
13
13
  {
14
- "description": "simple valid sin",
15
- "input": " 5 9 ",
14
+ "description": "a simple valid SIN that remains valid if reversed",
15
+ "input": "059",
16
16
  "expected": true
17
17
  },
18
18
  {
19
- "description": "valid Canadian SIN",
20
- "input": "046 454 286",
19
+ "description": "a simple valid SIN that becomes invalid if reversed",
20
+ "input": "59",
21
+ "expected": true
22
+ },
23
+ {
24
+ "description": "a valid Canadian SIN",
25
+ "input": "055 444 285",
21
26
  "expected": true
22
27
  },
23
28
  {
24
29
  "description": "invalid Canadian SIN",
25
- "input": "046 454 287",
30
+ "input": "055 444 286",
26
31
  "expected": false
27
32
  },
28
33
  {
@@ -31,17 +36,17 @@
31
36
  "expected": false
32
37
  },
33
38
  {
34
- "description": "valid strings with a non-digit added become invalid",
35
- "input": "046a 454 286",
39
+ "description": "valid strings with a non-digit included become invalid",
40
+ "input": "055a 444 285",
36
41
  "expected": false
37
42
  },
38
43
  {
39
- "description": "punctuation is not allowed",
44
+ "description": "valid strings with punctuation included become invalid",
40
45
  "input": "055-444-285",
41
46
  "expected": false
42
47
  },
43
48
  {
44
- "description": "symbols are not allowed",
49
+ "description": "valid strings with symbols included become invalid",
45
50
  "input": "055£ 444$ 285",
46
51
  "expected": false
47
52
  },
@@ -51,17 +56,12 @@
51
56
  "expected": false
52
57
  },
53
58
  {
54
- "description": "lots of zeros are valid",
55
- "input": " 00000",
56
- "expected": true
57
- },
58
- {
59
- "description": "another valid sin",
60
- "input": "055 444 285",
59
+ "description": "more than a single zero is valid",
60
+ "input": "0000 0",
61
61
  "expected": true
62
62
  },
63
63
  {
64
- "description": "nine doubled is nine",
64
+ "description": "input digit 9 is correctly converted to output digit 9",
65
65
  "input": "091",
66
66
  "expected": true
67
67
  }
@@ -1,4 +1,2 @@
1
1
  ---
2
2
  blurb: "Write a function that returns the name of an amino acid a particular codon, possibly using shorthand, encodes for."
3
- common:
4
- type: practice
@@ -1,4 +1,2 @@
1
1
  ---
2
2
  blurb: "Implement a basic reactive system."
3
- type: practice
4
- topics: ["observers", "reactive programming"]
@@ -1,5 +1,2 @@
1
1
  ---
2
2
  blurb: Count the rectangles in an ASCII diagram.
3
- common:
4
- type: practice
5
- focus: algorithms
@@ -1,6 +1,4 @@
1
1
  ---
2
2
  blurb: "Implement variable length quantity encoding and decoding."
3
- type: practice
4
3
  source: "A poor Splice developer having to implement MIDI encoding/decoding."
5
4
  source_url: "https://splice.com"
6
- topics: ["encoding", "decoding", "MIDI"]
@@ -0,0 +1,17 @@
1
+ {
2
+ "slug": "snowflake",
3
+ "language": "Snowflake",
4
+ "repository": "https://example.com/exercism/xsnowflake",
5
+ "active": true,
6
+ "test_pattern": "\\.tst$",
7
+ "problems": [
8
+ "apple",
9
+ "banana",
10
+ "cherry",
11
+ "snowflake-only"
12
+ ],
13
+ "deprecated": [
14
+ ],
15
+ "foregone": [
16
+ ]
17
+ }
@@ -0,0 +1 @@
1
+ Special snowflakes are _special_
@@ -0,0 +1,4 @@
1
+ ---
2
+ blurb: "This exercise only exists in snowflake"
3
+ source: "Special snowflake."
4
+ source_url: "http://snowflake.com"
@@ -0,0 +1,27 @@
1
+ require_relative 'guaranteed_file'
2
+
3
+ module Trackler
4
+ class Description
5
+ def self.for(problem:, track: )
6
+ new(GuaranteedFile.for(problem: problem, track: track, filename: 'description.md'))
7
+ end
8
+
9
+ def initialize(description_file)
10
+ @file = description_file
11
+ @content = description_file.content
12
+ end
13
+ private_class_method :new
14
+
15
+ def to_s
16
+ @content
17
+ end
18
+
19
+ def url
20
+ @file.url
21
+ end
22
+
23
+ def exists?
24
+ !@content.empty?
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,77 @@
1
+ module Trackler
2
+ class GuaranteedFile
3
+ attr_accessor :content
4
+
5
+ def self.for(problem:, track:, filename:)
6
+ [TrackFile, CommonFile].detect(-> {NullFile}) do |d|
7
+ d.send(:exists?, problem: problem, track: track, filename: filename)
8
+ end.send(:new, problem: problem, track: track, filename: filename)
9
+ end
10
+
11
+ private
12
+
13
+ attr_accessor :problem, :track, :filename
14
+
15
+ def self.exists?(problem:, track:, filename:)
16
+ File.exists?(location(problem: problem, track: track, filename: filename))
17
+ end
18
+ private_class_method :exists?
19
+
20
+ def initialize(problem:, track:, filename:)
21
+ self.problem = problem
22
+ self.track = track
23
+ self.filename = filename
24
+ self.content = File.read(self.class.location(problem: problem, track: track, filename: filename))
25
+ end
26
+ private_class_method :new
27
+ end
28
+
29
+ class TrackFile < GuaranteedFile
30
+ def self.location(problem:, track:, filename:)
31
+ File.join(problem.root, 'tracks', track.id, 'exercises', problem.slug, filename)
32
+ end
33
+
34
+ def url
35
+ "#{track.repository}/blob/master/exercises/%s/#{filename}" % problem.slug
36
+ end
37
+ end
38
+
39
+ class CommonFile < GuaranteedFile
40
+ def self.location(problem:, filename:, **_track)
41
+ File.join(problem.root, 'common', 'exercises', problem.slug, filename)
42
+ end
43
+
44
+ def url
45
+ "https://github.com/exercism/x-common/blob/master/exercises/%s/#{filename}" % problem.slug
46
+ end
47
+ end
48
+
49
+ class NullFile < GuaranteedFile
50
+ def method_missing(*)
51
+ # NOOP
52
+ end
53
+
54
+ def respond_to?(*)
55
+ true
56
+ end
57
+
58
+ def inspect
59
+ "<null>"
60
+ end
61
+
62
+ def exists?
63
+ false
64
+ end
65
+
66
+ def content
67
+ ""
68
+ end
69
+
70
+ def initialize(*)
71
+ self
72
+ end
73
+
74
+ klass = self
75
+ define_method(:class) { klass }
76
+ end
77
+ end
@@ -3,12 +3,12 @@ module Trackler
3
3
  class Implementations
4
4
  include Enumerable
5
5
 
6
- attr_reader :track_id, :repo, :slugs, :root
7
- def initialize(track_id, repo, slugs, root)
8
- @track_id = track_id
6
+ attr_reader :repo, :slugs, :root, :track
7
+ def initialize(repo, slugs, root, track)
9
8
  @repo = repo
10
9
  @slugs = slugs
11
10
  @root = root
11
+ @track = track
12
12
  end
13
13
 
14
14
  def each
@@ -25,7 +25,7 @@ module Trackler
25
25
 
26
26
  def all
27
27
  @all ||= slugs.map { |slug|
28
- Implementation.new(track_id, repo, Problem.new(slug, root), root)
28
+ Implementation.new(track.id, repo, Problem.new(slug, root, track), root)
29
29
  }
30
30
  end
31
31
 
@@ -35,7 +35,7 @@ module Trackler
35
35
 
36
36
  def implementation_map
37
37
  hash = Hash.new { |_, k|
38
- Implementation.new(track_id, repo, Problem.new(k, root), root)
38
+ Implementation.new(track.id, repo, Problem.new(k, root, track), root)
39
39
  }
40
40
  all.each do |impl|
41
41
  hash[impl.problem.slug] = impl
@@ -0,0 +1,27 @@
1
+ require_relative 'guaranteed_file'
2
+
3
+ module Trackler
4
+ class Metadata
5
+ def self.for(problem:, track: )
6
+ new(GuaranteedFile.for(problem: problem, track: track, filename: 'metadata.yml'))
7
+ end
8
+
9
+ attr_accessor :blurb, :source, :source_url
10
+
11
+ def initialize(metadata_file)
12
+ @file = metadata_file
13
+ @attrs = YAML.load(@file.content) || {}
14
+ %w(blurb source source_url).each do |attr|
15
+ self.send("#{attr}=".to_sym, @attrs[attr].to_s.strip)
16
+ end
17
+ end
18
+
19
+ def url
20
+ @file.url
21
+ end
22
+
23
+ def exists?
24
+ !@attrs.empty?
25
+ end
26
+ end
27
+ end