trackler 2.1.0.4 → 2.1.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (237) hide show
  1. checksums.yaml +4 -4
  2. data/lib/trackler/version.rb +1 -1
  3. data/tracks/ecmascript/.travis.yml +1 -0
  4. data/tracks/ecmascript/Makefile +13 -18
  5. data/tracks/ecmascript/README.md +4 -8
  6. data/tracks/ecmascript/docs/INSTALLATION.md +1 -17
  7. data/tracks/ecmascript/docs/TESTS.md +10 -3
  8. data/tracks/ecmascript/exercises/accumulate/package.json +62 -13
  9. data/tracks/ecmascript/exercises/acronym/package.json +62 -13
  10. data/tracks/ecmascript/exercises/all-your-base/package.json +62 -13
  11. data/tracks/ecmascript/exercises/allergies/package.json +62 -13
  12. data/tracks/ecmascript/exercises/anagram/package.json +62 -13
  13. data/tracks/ecmascript/exercises/atbash-cipher/package.json +62 -13
  14. data/tracks/ecmascript/exercises/beer-song/package.json +62 -13
  15. data/tracks/ecmascript/exercises/binary-search-tree/package.json +62 -13
  16. data/tracks/ecmascript/exercises/binary-search/package.json +62 -13
  17. data/tracks/ecmascript/exercises/binary/package.json +62 -13
  18. data/tracks/ecmascript/exercises/bob/package.json +62 -13
  19. data/tracks/ecmascript/exercises/bracket-push/package.json +62 -13
  20. data/tracks/ecmascript/exercises/circular-buffer/package.json +62 -13
  21. data/tracks/ecmascript/exercises/clock/package.json +62 -13
  22. data/tracks/ecmascript/exercises/crypto-square/package.json +62 -13
  23. data/tracks/ecmascript/exercises/custom-set/package.json +62 -13
  24. data/tracks/ecmascript/exercises/diamond/package.json +62 -13
  25. data/tracks/ecmascript/exercises/difference-of-squares/package.json +62 -13
  26. data/tracks/ecmascript/exercises/etl/package.json +62 -13
  27. data/tracks/ecmascript/exercises/food-chain/package.json +62 -13
  28. data/tracks/ecmascript/exercises/gigasecond/package.json +62 -13
  29. data/tracks/ecmascript/exercises/grade-school/package.json +62 -13
  30. data/tracks/ecmascript/exercises/grains/package.json +62 -13
  31. data/tracks/ecmascript/exercises/hamming/package.json +62 -13
  32. data/tracks/ecmascript/exercises/hello-world/example.js +5 -4
  33. data/tracks/ecmascript/exercises/hello-world/hello-world.js +7 -5
  34. data/tracks/ecmascript/exercises/hello-world/hello-world.spec.js +4 -2
  35. data/tracks/ecmascript/exercises/hello-world/package.json +62 -13
  36. data/tracks/ecmascript/exercises/hexadecimal/package.json +62 -13
  37. data/tracks/ecmascript/exercises/isogram/package.json +62 -13
  38. data/tracks/ecmascript/exercises/kindergarten-garden/package.json +62 -13
  39. data/tracks/ecmascript/exercises/largest-series-product/package.json +62 -13
  40. data/tracks/ecmascript/exercises/leap/example.js +10 -1
  41. data/tracks/ecmascript/exercises/leap/leap.spec.js +13 -30
  42. data/tracks/ecmascript/exercises/leap/package.json +62 -13
  43. data/tracks/ecmascript/exercises/linked-list/package.json +62 -13
  44. data/tracks/ecmascript/exercises/luhn/package.json +62 -13
  45. data/tracks/ecmascript/exercises/matrix/package.json +62 -13
  46. data/tracks/ecmascript/exercises/meetup/package.json +62 -13
  47. data/tracks/ecmascript/exercises/nth-prime/package.json +62 -13
  48. data/tracks/ecmascript/exercises/ocr-numbers/package.json +62 -13
  49. data/tracks/ecmascript/exercises/octal/package.json +62 -13
  50. data/tracks/ecmascript/exercises/package.json +62 -9
  51. data/tracks/ecmascript/exercises/palindrome-products/package.json +62 -13
  52. data/tracks/ecmascript/exercises/palindrome-products/palindrome-products.spec.js +28 -1
  53. data/tracks/ecmascript/exercises/pangram/package.json +62 -13
  54. data/tracks/ecmascript/exercises/pascals-triangle/package.json +62 -13
  55. data/tracks/ecmascript/exercises/perfect-numbers/example.js +1 -1
  56. data/tracks/ecmascript/exercises/perfect-numbers/package.json +62 -13
  57. data/tracks/ecmascript/exercises/perfect-numbers/perfect-numbers.spec.js +16 -14
  58. data/tracks/ecmascript/exercises/phone-number/package.json +62 -13
  59. data/tracks/ecmascript/exercises/pig-latin/package.json +62 -13
  60. data/tracks/ecmascript/exercises/prime-factors/package.json +62 -13
  61. data/tracks/ecmascript/exercises/pythagorean-triplet/package.json +62 -13
  62. data/tracks/ecmascript/exercises/queen-attack/package.json +62 -13
  63. data/tracks/ecmascript/exercises/raindrops/package.json +62 -13
  64. data/tracks/ecmascript/exercises/rna-transcription/package.json +62 -13
  65. data/tracks/ecmascript/exercises/robot-name/package.json +62 -13
  66. data/tracks/ecmascript/exercises/robot-simulator/package.json +62 -13
  67. data/tracks/ecmascript/exercises/roman-numerals/package.json +62 -13
  68. data/tracks/ecmascript/exercises/saddle-points/package.json +62 -13
  69. data/tracks/ecmascript/exercises/say/package.json +62 -13
  70. data/tracks/ecmascript/exercises/scrabble-score/package.json +62 -13
  71. data/tracks/ecmascript/exercises/secret-handshake/package.json +62 -13
  72. data/tracks/ecmascript/exercises/series/package.json +62 -13
  73. data/tracks/ecmascript/exercises/sieve/package.json +62 -13
  74. data/tracks/ecmascript/exercises/simple-cipher/package.json +62 -13
  75. data/tracks/ecmascript/exercises/space-age/package.json +62 -13
  76. data/tracks/ecmascript/exercises/strain/package.json +62 -13
  77. data/tracks/ecmascript/exercises/sum-of-multiples/package.json +62 -13
  78. data/tracks/ecmascript/exercises/triangle/package.json +62 -13
  79. data/tracks/ecmascript/exercises/trinary/package.json +62 -13
  80. data/tracks/ecmascript/exercises/two-bucket/package.json +62 -13
  81. data/tracks/ecmascript/exercises/word-count/package.json +62 -13
  82. data/tracks/ecmascript/exercises/wordy/package.json +62 -13
  83. data/tracks/ecmascript/package.json +62 -13
  84. data/tracks/erlang/.github/stale.yml +3 -0
  85. data/tracks/go/exercises/series/asktoomuch_test.go +1 -1
  86. data/tracks/go/exercises/series/example.go +2 -2
  87. data/tracks/go/exercises/series/first_example.go +1 -1
  88. data/tracks/go/exercises/series/first_test.go +1 -1
  89. data/tracks/go/exercises/series/series_test.go +2 -2
  90. data/tracks/ocaml/exercises/bracket-push/test.ml +2 -0
  91. data/tracks/ocaml/exercises/phone-number/example.ml +7 -2
  92. data/tracks/ocaml/exercises/phone-number/test.ml +11 -5
  93. data/tracks/ocaml/tools/test-generator/templates/phone-number/template.ml +1 -1
  94. data/tracks/pony/.github/stale.yml +16 -0
  95. data/tracks/purescript/config.json +7 -0
  96. data/tracks/purescript/exercises/pascals-triangle/bower.json +16 -0
  97. data/tracks/purescript/exercises/pascals-triangle/examples/src/PascalsTriangle.purs +24 -0
  98. data/tracks/purescript/exercises/pascals-triangle/src/PascalsTriangle.purs +1 -0
  99. data/tracks/purescript/exercises/pascals-triangle/test/Main.purs +74 -0
  100. data/tracks/ruby/.github/ISSUE_TEMPLATE.md +2 -2
  101. data/tracks/ruby/.github/PULL_REQUEST_TEMPLATE.md +14 -10
  102. data/tracks/ruby/.github/stale.yml +21 -0
  103. data/tracks/ruby/README.md +80 -74
  104. data/tracks/ruby/{lib → exercises/acronym/.meta/generator}/acronym_cases.rb +0 -0
  105. data/tracks/ruby/{lib → exercises/all-your-base/.meta/generator}/all_your_base_cases.rb +0 -0
  106. data/tracks/ruby/{lib → exercises/alphametics/.meta/generator}/alphametics_cases.rb +0 -0
  107. data/tracks/ruby/{lib → exercises/anagram/.meta/generator}/anagram_cases.rb +0 -0
  108. data/tracks/ruby/{lib → exercises/beer-song/.meta/generator}/beer_song_cases.rb +0 -0
  109. data/tracks/ruby/{lib → exercises/binary/.meta/generator}/binary_cases.rb +0 -0
  110. data/tracks/ruby/{lib → exercises/bowling/.meta/generator}/bowling_cases.rb +0 -0
  111. data/tracks/ruby/{lib → exercises/bracket-push/.meta/generator}/bracket_push_cases.rb +0 -0
  112. data/tracks/ruby/{lib → exercises/clock/.meta/generator}/clock_cases.rb +0 -0
  113. data/tracks/ruby/{lib → exercises/connect/.meta/generator}/connect_cases.rb +0 -0
  114. data/tracks/ruby/{lib → exercises/custom-set/.meta/generator}/custom_set_cases.rb +0 -0
  115. data/tracks/ruby/{lib → exercises/difference-of-squares/.meta/generator}/difference_of_squares_cases.rb +0 -0
  116. data/tracks/ruby/{lib → exercises/dominoes/.meta/generator}/dominoes_cases.rb +0 -0
  117. data/tracks/ruby/{lib → exercises/etl/.meta/generator}/etl_cases.rb +0 -0
  118. data/tracks/ruby/{lib → exercises/gigasecond/.meta/generator}/gigasecond_cases.rb +0 -0
  119. data/tracks/ruby/{lib → exercises/grains/.meta/generator}/grains_cases.rb +0 -0
  120. data/tracks/ruby/{lib → exercises/hamming/.meta/generator}/hamming_cases.rb +0 -0
  121. data/tracks/ruby/{lib → exercises/hello-world/.meta/generator}/hello_world_cases.rb +0 -0
  122. data/tracks/ruby/{lib → exercises/isogram/.meta/generator}/isogram_cases.rb +0 -0
  123. data/tracks/ruby/{lib → exercises/largest-series-product/.meta/generator}/largest_series_product_cases.rb +0 -0
  124. data/tracks/ruby/{lib → exercises/leap/.meta/generator}/leap_cases.rb +0 -0
  125. data/tracks/ruby/{lib → exercises/luhn/.meta/generator}/luhn_cases.rb +0 -0
  126. data/tracks/ruby/{lib → exercises/nth-prime/.meta/generator}/nth_prime_cases.rb +0 -0
  127. data/tracks/ruby/{lib → exercises/ocr-numbers/.meta/generator}/ocr_numbers_cases.rb +0 -0
  128. data/tracks/ruby/{lib → exercises/pangram/.meta/generator}/pangram_cases.rb +0 -0
  129. data/tracks/ruby/{lib → exercises/pig-latin/.meta/generator}/pig_latin_cases.rb +0 -0
  130. data/tracks/ruby/{lib → exercises/queen-attack/.meta/generator}/queen_attack_cases.rb +0 -0
  131. data/tracks/ruby/{lib → exercises/raindrops/.meta/generator}/raindrops_cases.rb +0 -0
  132. data/tracks/ruby/{lib → exercises/rna-transcription/.meta/generator}/rna_transcription_cases.rb +0 -0
  133. data/tracks/ruby/{lib → exercises/roman-numerals/.meta/generator}/roman_numerals_cases.rb +0 -0
  134. data/tracks/ruby/{lib → exercises/run-length-encoding/.meta/generator}/run_length_encoding_cases.rb +0 -0
  135. data/tracks/ruby/{lib → exercises/say/.meta/generator}/say_cases.rb +0 -0
  136. data/tracks/ruby/{lib → exercises/sieve/.meta/generator}/sieve_cases.rb +0 -0
  137. data/tracks/ruby/{lib → exercises/tournament/.meta/generator}/tournament_cases.rb +0 -0
  138. data/tracks/ruby/{lib → exercises/transpose/.meta/generator}/transpose_cases.rb +0 -0
  139. data/tracks/ruby/{lib → exercises/triangle/.meta/generator}/triangle_cases.rb +0 -0
  140. data/tracks/ruby/{lib → exercises/two-bucket/.meta/generator}/two_bucket_cases.rb +0 -0
  141. data/tracks/ruby/{lib → exercises/word-count/.meta/generator}/word_count_cases.rb +0 -0
  142. data/tracks/ruby/{lib → exercises/wordy/.meta/generator}/wordy_cases.rb +0 -0
  143. data/tracks/ruby/lib/generator/files.rb +5 -1
  144. data/tracks/ruby/lib/generator/files/generator_cases.rb +18 -4
  145. data/tracks/ruby/lib/generator/files/metadata_files.rb +3 -0
  146. data/tracks/ruby/lib/generator/files/track_files.rb +24 -6
  147. data/tracks/ruby/test/fixtures/xruby/exercises/alpha/.meta/generator/test_template.erb +23 -0
  148. data/tracks/ruby/test/fixtures/xruby/exercises/beta/.meta/.version +1 -0
  149. data/tracks/ruby/test/fixtures/xruby/{lib → exercises/beta/.meta/generator}/beta_cases.rb +0 -0
  150. data/tracks/ruby/test/fixtures/xruby/exercises/beta/example.rb +5 -0
  151. data/tracks/ruby/test/fixtures/xruby/exercises/{alpha → beta}/example.tt +10 -7
  152. data/tracks/ruby/test/generator/files/generate_cases_test.rb +25 -1
  153. data/tracks/ruby/test/generator/files/metadata_files_test.rb +21 -0
  154. data/tracks/ruby/test/generator/files/track_files_test.rb +20 -3
  155. data/tracks/ruby/test/generator/files_test.rb +18 -0
  156. data/tracks/ruby/test/wordy_cases_test.rb +1 -0
  157. data/tracks/typescript/README.md +1 -1
  158. data/tracks/typescript/config.json +6 -0
  159. data/tracks/typescript/exercises/difference-of-squares/difference-of-squares.example.ts +39 -0
  160. data/tracks/typescript/exercises/difference-of-squares/difference-of-squares.test.ts +56 -0
  161. data/tracks/typescript/exercises/difference-of-squares/package.json +36 -0
  162. data/tracks/typescript/exercises/difference-of-squares/tsconfig.json +21 -0
  163. data/tracks/typescript/exercises/difference-of-squares/tslint.json +127 -0
  164. data/tracks/typescript/exercises/difference-of-squares/yarn.lock +2739 -0
  165. data/tracks/typescript/exercises/wordy/wordy.example.ts +1 -1
  166. metadata +56 -114
  167. data/tracks/csharp/.github/stale.yml +0 -0
  168. data/tracks/ecmascript/exercises/accumulate/gulpfile.js +0 -92
  169. data/tracks/ecmascript/exercises/acronym/gulpfile.js +0 -92
  170. data/tracks/ecmascript/exercises/all-your-base/gulpfile.js +0 -92
  171. data/tracks/ecmascript/exercises/allergies/gulpfile.js +0 -92
  172. data/tracks/ecmascript/exercises/anagram/gulpfile.js +0 -92
  173. data/tracks/ecmascript/exercises/atbash-cipher/gulpfile.js +0 -92
  174. data/tracks/ecmascript/exercises/beer-song/gulpfile.js +0 -92
  175. data/tracks/ecmascript/exercises/binary-search-tree/gulpfile.js +0 -92
  176. data/tracks/ecmascript/exercises/binary-search/gulpfile.js +0 -92
  177. data/tracks/ecmascript/exercises/binary/gulpfile.js +0 -92
  178. data/tracks/ecmascript/exercises/bob/gulpfile.js +0 -92
  179. data/tracks/ecmascript/exercises/bracket-push/gulpfile.js +0 -92
  180. data/tracks/ecmascript/exercises/circular-buffer/gulpfile.js +0 -92
  181. data/tracks/ecmascript/exercises/clock/gulpfile.js +0 -92
  182. data/tracks/ecmascript/exercises/crypto-square/gulpfile.js +0 -92
  183. data/tracks/ecmascript/exercises/custom-set/gulpfile.js +0 -92
  184. data/tracks/ecmascript/exercises/diamond/gulpfile.js +0 -92
  185. data/tracks/ecmascript/exercises/difference-of-squares/gulpfile.js +0 -92
  186. data/tracks/ecmascript/exercises/etl/gulpfile.js +0 -92
  187. data/tracks/ecmascript/exercises/food-chain/gulpfile.js +0 -92
  188. data/tracks/ecmascript/exercises/gigasecond/gulpfile.js +0 -92
  189. data/tracks/ecmascript/exercises/grade-school/gulpfile.js +0 -92
  190. data/tracks/ecmascript/exercises/grains/gulpfile.js +0 -92
  191. data/tracks/ecmascript/exercises/gulpfile.js +0 -89
  192. data/tracks/ecmascript/exercises/hamming/gulpfile.js +0 -92
  193. data/tracks/ecmascript/exercises/hello-world/gulpfile.js +0 -92
  194. data/tracks/ecmascript/exercises/hexadecimal/gulpfile.js +0 -92
  195. data/tracks/ecmascript/exercises/isogram/gulpfile.js +0 -92
  196. data/tracks/ecmascript/exercises/kindergarten-garden/gulpfile.js +0 -92
  197. data/tracks/ecmascript/exercises/largest-series-product/gulpfile.js +0 -92
  198. data/tracks/ecmascript/exercises/leap/gulpfile.js +0 -92
  199. data/tracks/ecmascript/exercises/linked-list/gulpfile.js +0 -92
  200. data/tracks/ecmascript/exercises/luhn/gulpfile.js +0 -92
  201. data/tracks/ecmascript/exercises/matrix/gulpfile.js +0 -92
  202. data/tracks/ecmascript/exercises/meetup/gulpfile.js +0 -92
  203. data/tracks/ecmascript/exercises/nth-prime/gulpfile.js +0 -92
  204. data/tracks/ecmascript/exercises/ocr-numbers/gulpfile.js +0 -92
  205. data/tracks/ecmascript/exercises/octal/gulpfile.js +0 -92
  206. data/tracks/ecmascript/exercises/palindrome-products/gulpfile.js +0 -92
  207. data/tracks/ecmascript/exercises/palindrome-products/palindrome-products.js +0 -18
  208. data/tracks/ecmascript/exercises/pangram/gulpfile.js +0 -92
  209. data/tracks/ecmascript/exercises/pascals-triangle/gulpfile.js +0 -92
  210. data/tracks/ecmascript/exercises/perfect-numbers/gulpfile.js +0 -92
  211. data/tracks/ecmascript/exercises/phone-number/gulpfile.js +0 -92
  212. data/tracks/ecmascript/exercises/pig-latin/gulpfile.js +0 -92
  213. data/tracks/ecmascript/exercises/prime-factors/gulpfile.js +0 -92
  214. data/tracks/ecmascript/exercises/pythagorean-triplet/gulpfile.js +0 -92
  215. data/tracks/ecmascript/exercises/queen-attack/gulpfile.js +0 -92
  216. data/tracks/ecmascript/exercises/raindrops/gulpfile.js +0 -92
  217. data/tracks/ecmascript/exercises/rna-transcription/gulpfile.js +0 -92
  218. data/tracks/ecmascript/exercises/robot-name/gulpfile.js +0 -92
  219. data/tracks/ecmascript/exercises/robot-simulator/gulpfile.js +0 -92
  220. data/tracks/ecmascript/exercises/roman-numerals/gulpfile.js +0 -92
  221. data/tracks/ecmascript/exercises/saddle-points/gulpfile.js +0 -92
  222. data/tracks/ecmascript/exercises/say/gulpfile.js +0 -92
  223. data/tracks/ecmascript/exercises/scrabble-score/gulpfile.js +0 -92
  224. data/tracks/ecmascript/exercises/secret-handshake/gulpfile.js +0 -92
  225. data/tracks/ecmascript/exercises/series/gulpfile.js +0 -92
  226. data/tracks/ecmascript/exercises/sieve/gulpfile.js +0 -92
  227. data/tracks/ecmascript/exercises/simple-cipher/gulpfile.js +0 -92
  228. data/tracks/ecmascript/exercises/space-age/gulpfile.js +0 -92
  229. data/tracks/ecmascript/exercises/strain/gulpfile.js +0 -92
  230. data/tracks/ecmascript/exercises/sum-of-multiples/gulpfile.js +0 -92
  231. data/tracks/ecmascript/exercises/triangle/gulpfile.js +0 -92
  232. data/tracks/ecmascript/exercises/trinary/gulpfile.js +0 -92
  233. data/tracks/ecmascript/exercises/two-bucket/gulpfile.js +0 -92
  234. data/tracks/ecmascript/exercises/word-count/gulpfile.js +0 -92
  235. data/tracks/ecmascript/exercises/wordy/gulpfile.js +0 -92
  236. data/tracks/ecmascript/gulpfile.js +0 -92
  237. data/tracks/fsharp/.github/stale.yml +0 -0
@@ -9,22 +9,71 @@
9
9
  "url": "https://github.com/exercism/xecmascript"
10
10
  },
11
11
  "devDependencies": {
12
- "babel-cli": "^6.24.1",
13
- "babel-core": "^6.24.1",
14
- "babel-plugin-transform-object-rest-spread": "^6.23.0",
15
- "babel-polyfill": "^6.23.0",
12
+ "babel-jest": "^19.0.0",
16
13
  "babel-preset-env": "^1.3.3",
17
- "babel-preset-es2015": "^6.24.1",
18
- "del": "~2.0.2",
19
- "gulp": "~3.9.0",
20
- "gulp-babel": "^6.1.2",
21
- "gulp-eslint": "^1.1.0",
22
- "gulp-jasmine": "~2.4.2",
23
- "yargs": "~3.27.0"
14
+ "eslint": "^3.19.0",
15
+ "jest": "^19.0.2"
16
+ },
17
+ "jest": {
18
+ "modulePathIgnorePatterns": [
19
+ "package.json"
20
+ ]
21
+ },
22
+ "babel": {
23
+ "presets": [
24
+ "env"
25
+ ]
24
26
  },
25
27
  "scripts": {
26
- "test": "gulp test",
27
- "lint-test": "gulp lint test"
28
+ "test": "jest --no-cache ./*",
29
+ "watch": "jest --no-cache --watch ./*",
30
+ "lint": "eslint *.js; exit 0;",
31
+ "lint-test": "eslint *.js && jest --no-cache ./* "
32
+ },
33
+ "eslintConfig": {
34
+ "parserOptions": {
35
+ "ecmaVersion": 6,
36
+ "sourceType": "module"
37
+ },
38
+ "rules": {
39
+ "comma-dangle": [
40
+ 2,
41
+ "never"
42
+ ],
43
+ "no-cond-assign": [
44
+ 2,
45
+ "always"
46
+ ],
47
+ "no-console": 2,
48
+ "no-constant-condition": 2,
49
+ "no-control-regex": 2,
50
+ "no-debugger": 2,
51
+ "no-dupe-args": 2,
52
+ "no-dupe-keys": 2,
53
+ "no-duplicate-case": 2,
54
+ "no-empty-character-class": 2,
55
+ "no-empty": 2,
56
+ "no-ex-assign": 2,
57
+ "no-extra-boolean-cast": 2,
58
+ "no-extra-parens": 2,
59
+ "no-extra-semi": 2,
60
+ "no-func-assign": 2,
61
+ "no-inner-declarations": [
62
+ 2,
63
+ "both"
64
+ ],
65
+ "no-invalid-regexp": 2,
66
+ "no-irregular-whitespace": 2,
67
+ "no-negated-in-lhs": 2,
68
+ "no-obj-calls": 2,
69
+ "no-regex-spaces": 2,
70
+ "no-sparse-arrays": 2,
71
+ "no-unexpected-multiline": 2,
72
+ "no-unreachable": 2,
73
+ "use-isnan": 2,
74
+ "valid-jsdoc": 2,
75
+ "valid-typeof": 2
76
+ }
28
77
  },
29
78
  "licenses": [
30
79
  "MIT"
@@ -9,22 +9,71 @@
9
9
  "url": "https://github.com/exercism/xecmascript"
10
10
  },
11
11
  "devDependencies": {
12
- "babel-cli": "^6.24.1",
13
- "babel-core": "^6.24.1",
14
- "babel-plugin-transform-object-rest-spread": "^6.23.0",
15
- "babel-polyfill": "^6.23.0",
12
+ "babel-jest": "^19.0.0",
16
13
  "babel-preset-env": "^1.3.3",
17
- "babel-preset-es2015": "^6.24.1",
18
- "del": "~2.0.2",
19
- "gulp": "~3.9.0",
20
- "gulp-babel": "^6.1.2",
21
- "gulp-eslint": "^1.1.0",
22
- "gulp-jasmine": "~2.4.2",
23
- "yargs": "~3.27.0"
14
+ "eslint": "^3.19.0",
15
+ "jest": "^19.0.2"
16
+ },
17
+ "jest": {
18
+ "modulePathIgnorePatterns": [
19
+ "package.json"
20
+ ]
21
+ },
22
+ "babel": {
23
+ "presets": [
24
+ "env"
25
+ ]
24
26
  },
25
27
  "scripts": {
26
- "test": "gulp test",
27
- "lint-test": "gulp lint test"
28
+ "test": "jest --no-cache ./*",
29
+ "watch": "jest --no-cache --watch ./*",
30
+ "lint": "eslint *.js; exit 0;",
31
+ "lint-test": "eslint *.js && jest --no-cache ./* "
32
+ },
33
+ "eslintConfig": {
34
+ "parserOptions": {
35
+ "ecmaVersion": 6,
36
+ "sourceType": "module"
37
+ },
38
+ "rules": {
39
+ "comma-dangle": [
40
+ 2,
41
+ "never"
42
+ ],
43
+ "no-cond-assign": [
44
+ 2,
45
+ "always"
46
+ ],
47
+ "no-console": 2,
48
+ "no-constant-condition": 2,
49
+ "no-control-regex": 2,
50
+ "no-debugger": 2,
51
+ "no-dupe-args": 2,
52
+ "no-dupe-keys": 2,
53
+ "no-duplicate-case": 2,
54
+ "no-empty-character-class": 2,
55
+ "no-empty": 2,
56
+ "no-ex-assign": 2,
57
+ "no-extra-boolean-cast": 2,
58
+ "no-extra-parens": 2,
59
+ "no-extra-semi": 2,
60
+ "no-func-assign": 2,
61
+ "no-inner-declarations": [
62
+ 2,
63
+ "both"
64
+ ],
65
+ "no-invalid-regexp": 2,
66
+ "no-irregular-whitespace": 2,
67
+ "no-negated-in-lhs": 2,
68
+ "no-obj-calls": 2,
69
+ "no-regex-spaces": 2,
70
+ "no-sparse-arrays": 2,
71
+ "no-unexpected-multiline": 2,
72
+ "no-unreachable": 2,
73
+ "use-isnan": 2,
74
+ "valid-jsdoc": 2,
75
+ "valid-typeof": 2
76
+ }
28
77
  },
29
78
  "licenses": [
30
79
  "MIT"
@@ -0,0 +1,3 @@
1
+ exemptLabels:
2
+ - "first-timers only"
3
+ - "good first patch"
@@ -1,6 +1,6 @@
1
1
  // +build asktoomuch
2
2
 
3
- package slice
3
+ package series
4
4
 
5
5
  import "testing"
6
6
 
@@ -1,6 +1,6 @@
1
- package slice
1
+ package series
2
2
 
3
- const testVersion = 1
3
+ const testVersion = 2
4
4
 
5
5
  func All(n int, s string) (r []string) {
6
6
  for i := 0; n <= len(s); i++ {
@@ -1,4 +1,4 @@
1
- package slice
1
+ package series
2
2
 
3
3
  func First(n int, s string) (string, bool) {
4
4
  if n > len(s) {
@@ -1,6 +1,6 @@
1
1
  // +build first
2
2
 
3
- package slice
3
+ package series
4
4
 
5
5
  import "testing"
6
6
 
@@ -27,14 +27,14 @@
27
27
  //
28
28
  // and test with `go test -tags first`.
29
29
 
30
- package slice
30
+ package series
31
31
 
32
32
  import (
33
33
  "reflect"
34
34
  "testing"
35
35
  )
36
36
 
37
- const targetTestVersion = 1
37
+ const targetTestVersion = 2
38
38
 
39
39
  var allTests = []struct {
40
40
  n int
@@ -14,6 +14,8 @@ let tests = [
14
14
  ae false (are_balanced "[[");
15
15
  "wrong ordered brackets" >::
16
16
  ae false (are_balanced "}{");
17
+ "wrong closing bracket" >::
18
+ ae false (are_balanced "{]");
17
19
  "paired with whitespace" >::
18
20
  ae true (are_balanced "{ }");
19
21
  "simple nested brackets" >::
@@ -1,11 +1,16 @@
1
1
  open Core.Std
2
2
 
3
+ let check_valid_first_digits s =
4
+ if s.[0] = '0' || s.[0] = '1' || s.[3] = '0' || s.[3] = '1'
5
+ then None
6
+ else Some s
7
+
3
8
  let number s =
4
9
  if not @@ String.is_empty (String.filter ~f:(Char.is_alpha) s)
5
10
  then None
6
11
  else
7
12
  let s = String.filter ~f:(Char.is_digit) s in
8
13
  match String.length s with
9
- | 10 -> Some s
10
- | 11 when String.get s 0 = '1' -> Some (String.drop_prefix s 1)
14
+ | 10 -> check_valid_first_digits s
15
+ | 11 when String.get s 0 = '1' -> check_valid_first_digits (String.drop_prefix s 1)
11
16
  | _ -> None
@@ -11,17 +11,19 @@ let ae exp got _test_ctxt =
11
11
 
12
12
  let tests = [
13
13
  "cleans the number" >::
14
- ae (Some "1234567890") (number "(123) 456-7890");
14
+ ae (Some "2234567890") (number "(223) 456-7890");
15
15
  "cleans numbers with dots" >::
16
- ae (Some "1234567890") (number "123.456.7890");
16
+ ae (Some "2234567890") (number "223.456.7890");
17
17
  "cleans numbers with multiple spaces" >::
18
- ae (Some "1234567890") (number "123 456 7890 ");
18
+ ae (Some "2234567890") (number "223 456 7890 ");
19
19
  "invalid when 9 digits" >::
20
20
  ae None (number "123456789");
21
21
  "invalid when 11 digits does not start with a 1" >::
22
- ae None (number "21234567890");
22
+ ae None (number "22234567890");
23
23
  "valid when 11 digits and starting with 1" >::
24
- ae (Some "1234567890") (number "11234567890");
24
+ ae (Some "2234567890") (number "12234567890");
25
+ "valid when 11 digits and starting with 1 even with punctuation" >::
26
+ ae (Some "2234567890") (number "+1 (223) 456-7890");
25
27
  "invalid when more than 11 digits" >::
26
28
  ae None (number "321234567890");
27
29
  "invalid with letters" >::
@@ -30,6 +32,10 @@ let tests = [
30
32
  ae None (number "123-@:!-7890");
31
33
  "invalid with right number of digits but letters mixed in" >::
32
34
  ae None (number "1a2b3c4d5e6f7g8h9i0j");
35
+ "invalid if area code does not start with 2-9" >::
36
+ ae None (number "(123) 456-7890");
37
+ "invalid if exchange code does not start with 2-9" >::
38
+ ae None (number "(223) 056-7890");
33
39
  ]
34
40
 
35
41
  let () =
@@ -17,4 +17,4 @@ END TEST *)
17
17
  ]
18
18
 
19
19
  let () =
20
- run_test_tt_main ("phone-number tests" >::: number_tests)
20
+ run_test_tt_main ("phone-number tests" >::: tests)
@@ -0,0 +1,16 @@
1
+ # Configuration for probot-stale - https://github.com/probot/stale
2
+
3
+ # Number of days of inactivity before an Issue or Pull Request becomes stale
4
+ daysUntilStale: 60
5
+ # Number of days of inactivity before a stale Issue or Pull Request is closed
6
+ daysUntilClose: 7
7
+ # Issues or Pull Requests with these labels will never be considered stale
8
+ exemptLabels:
9
+ - pinned
10
+ # Label to use when marking as stale
11
+ staleLabel: wontfix
12
+ # Comment to post when marking as stale.
13
+ markComment: >
14
+ This issue has been automatically marked as stale because it has not had
15
+ recent activity. It will be closed if no further activity occurs. Thank you
16
+ for your contributions.
@@ -166,6 +166,13 @@
166
166
  "topics": [
167
167
  "strings"
168
168
  ]
169
+ },
170
+ {
171
+ "slug": "pascals-triangle",
172
+ "difficulty": 1,
173
+ "topics": [
174
+ "arrays"
175
+ ]
169
176
  }
170
177
  ],
171
178
  "deprecated": [
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "pascals-triangle",
3
+ "ignore": [
4
+ "**/.*",
5
+ "node_modules",
6
+ "bower_components",
7
+ "output"
8
+ ],
9
+ "dependencies": {
10
+ "purescript-prelude": "^3.0.0"
11
+ },
12
+ "devDependencies": {
13
+ "purescript-psci-support": "^3.0.0",
14
+ "purescript-test-unit": "^11.0.0"
15
+ }
16
+ }
@@ -0,0 +1,24 @@
1
+ module PascalsTriangle
2
+ (rows
3
+ ) where
4
+
5
+ import Prelude
6
+ import Data.Array (drop, zip, (:))
7
+ import Data.Maybe (Maybe(..))
8
+ import Data.Tuple (uncurry)
9
+
10
+ type Row = Array Int
11
+ type Mat = Array (Array Int)
12
+
13
+ rows' :: Row -> Int -> Mat
14
+ rows' row 1 = [row]
15
+ rows' row n = row : rows' next (n - 1)
16
+ where next = pairSum $ [0] <> row <> [0]
17
+ pairSum r = map (uncurry (+)) (zip r (drop 1 r))
18
+
19
+ rows :: Maybe Int -> Maybe Mat
20
+ rows Nothing = Nothing
21
+ rows (Just n)
22
+ | n < 0 = Nothing
23
+ | n == 0 = Just []
24
+ | otherwise = Just $ rows' [1] n
@@ -0,0 +1 @@
1
+ module PascalsTriangle (rows) where
@@ -0,0 +1,74 @@
1
+ module Test.Main where
2
+
3
+ import Prelude
4
+ import Test.Unit.Assert as Assert
5
+ import Control.Monad.Aff.AVar (AVAR)
6
+ import Control.Monad.Eff (Eff)
7
+ import Control.Monad.Eff.Console (CONSOLE)
8
+ import Data.Maybe (Maybe(..))
9
+ import PascalsTriangle (rows)
10
+ import Test.Unit (suite, test)
11
+ import Test.Unit.Console (TESTOUTPUT)
12
+ import Test.Unit.Main (runTest)
13
+
14
+ main :: Eff ( console :: CONSOLE
15
+ , testOutput :: TESTOUTPUT
16
+ , avar :: AVAR
17
+ )
18
+ Unit
19
+ main = runTest do
20
+ suite "Given a count, return a collection of that many rows of pascal's triangle" do
21
+
22
+ test "zero rows" $
23
+ Assert.equal
24
+ (Just
25
+ []
26
+ )
27
+ (rows (Just 0))
28
+
29
+ test "single row" $
30
+ Assert.equal
31
+ (Just
32
+ [[1]]
33
+ )
34
+ (rows (Just 1))
35
+
36
+ test "two rows" $
37
+ Assert.equal
38
+ (Just
39
+ [ [1]
40
+ , [1,1]
41
+ ]
42
+ )
43
+ (rows (Just 2))
44
+
45
+ test "three rows" $
46
+ Assert.equal
47
+ (Just
48
+ [ [1]
49
+ , [1,1]
50
+ , [1,2,1]
51
+ ]
52
+ )
53
+ (rows (Just 3))
54
+
55
+ test "four rows" $
56
+ Assert.equal
57
+ (Just
58
+ [ [1]
59
+ , [1,1]
60
+ , [1,2,1]
61
+ , [1,3,3,1]
62
+ ]
63
+ )
64
+ (rows (Just 4))
65
+
66
+ test "negative rows" $
67
+ Assert.equal
68
+ Nothing
69
+ (rows (Just (-1)))
70
+
71
+ test "null/no rows" $
72
+ Assert.equal
73
+ Nothing
74
+ (rows Nothing)