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.
- checksums.yaml +4 -4
- data/lib/trackler/version.rb +1 -1
- data/tracks/ecmascript/.travis.yml +1 -0
- data/tracks/ecmascript/Makefile +13 -18
- data/tracks/ecmascript/README.md +4 -8
- data/tracks/ecmascript/docs/INSTALLATION.md +1 -17
- data/tracks/ecmascript/docs/TESTS.md +10 -3
- data/tracks/ecmascript/exercises/accumulate/package.json +62 -13
- data/tracks/ecmascript/exercises/acronym/package.json +62 -13
- data/tracks/ecmascript/exercises/all-your-base/package.json +62 -13
- data/tracks/ecmascript/exercises/allergies/package.json +62 -13
- data/tracks/ecmascript/exercises/anagram/package.json +62 -13
- data/tracks/ecmascript/exercises/atbash-cipher/package.json +62 -13
- data/tracks/ecmascript/exercises/beer-song/package.json +62 -13
- data/tracks/ecmascript/exercises/binary-search-tree/package.json +62 -13
- data/tracks/ecmascript/exercises/binary-search/package.json +62 -13
- data/tracks/ecmascript/exercises/binary/package.json +62 -13
- data/tracks/ecmascript/exercises/bob/package.json +62 -13
- data/tracks/ecmascript/exercises/bracket-push/package.json +62 -13
- data/tracks/ecmascript/exercises/circular-buffer/package.json +62 -13
- data/tracks/ecmascript/exercises/clock/package.json +62 -13
- data/tracks/ecmascript/exercises/crypto-square/package.json +62 -13
- data/tracks/ecmascript/exercises/custom-set/package.json +62 -13
- data/tracks/ecmascript/exercises/diamond/package.json +62 -13
- data/tracks/ecmascript/exercises/difference-of-squares/package.json +62 -13
- data/tracks/ecmascript/exercises/etl/package.json +62 -13
- data/tracks/ecmascript/exercises/food-chain/package.json +62 -13
- data/tracks/ecmascript/exercises/gigasecond/package.json +62 -13
- data/tracks/ecmascript/exercises/grade-school/package.json +62 -13
- data/tracks/ecmascript/exercises/grains/package.json +62 -13
- data/tracks/ecmascript/exercises/hamming/package.json +62 -13
- data/tracks/ecmascript/exercises/hello-world/example.js +5 -4
- data/tracks/ecmascript/exercises/hello-world/hello-world.js +7 -5
- data/tracks/ecmascript/exercises/hello-world/hello-world.spec.js +4 -2
- data/tracks/ecmascript/exercises/hello-world/package.json +62 -13
- data/tracks/ecmascript/exercises/hexadecimal/package.json +62 -13
- data/tracks/ecmascript/exercises/isogram/package.json +62 -13
- data/tracks/ecmascript/exercises/kindergarten-garden/package.json +62 -13
- data/tracks/ecmascript/exercises/largest-series-product/package.json +62 -13
- data/tracks/ecmascript/exercises/leap/example.js +10 -1
- data/tracks/ecmascript/exercises/leap/leap.spec.js +13 -30
- data/tracks/ecmascript/exercises/leap/package.json +62 -13
- data/tracks/ecmascript/exercises/linked-list/package.json +62 -13
- data/tracks/ecmascript/exercises/luhn/package.json +62 -13
- data/tracks/ecmascript/exercises/matrix/package.json +62 -13
- data/tracks/ecmascript/exercises/meetup/package.json +62 -13
- data/tracks/ecmascript/exercises/nth-prime/package.json +62 -13
- data/tracks/ecmascript/exercises/ocr-numbers/package.json +62 -13
- data/tracks/ecmascript/exercises/octal/package.json +62 -13
- data/tracks/ecmascript/exercises/package.json +62 -9
- data/tracks/ecmascript/exercises/palindrome-products/package.json +62 -13
- data/tracks/ecmascript/exercises/palindrome-products/palindrome-products.spec.js +28 -1
- data/tracks/ecmascript/exercises/pangram/package.json +62 -13
- data/tracks/ecmascript/exercises/pascals-triangle/package.json +62 -13
- data/tracks/ecmascript/exercises/perfect-numbers/example.js +1 -1
- data/tracks/ecmascript/exercises/perfect-numbers/package.json +62 -13
- data/tracks/ecmascript/exercises/perfect-numbers/perfect-numbers.spec.js +16 -14
- data/tracks/ecmascript/exercises/phone-number/package.json +62 -13
- data/tracks/ecmascript/exercises/pig-latin/package.json +62 -13
- data/tracks/ecmascript/exercises/prime-factors/package.json +62 -13
- data/tracks/ecmascript/exercises/pythagorean-triplet/package.json +62 -13
- data/tracks/ecmascript/exercises/queen-attack/package.json +62 -13
- data/tracks/ecmascript/exercises/raindrops/package.json +62 -13
- data/tracks/ecmascript/exercises/rna-transcription/package.json +62 -13
- data/tracks/ecmascript/exercises/robot-name/package.json +62 -13
- data/tracks/ecmascript/exercises/robot-simulator/package.json +62 -13
- data/tracks/ecmascript/exercises/roman-numerals/package.json +62 -13
- data/tracks/ecmascript/exercises/saddle-points/package.json +62 -13
- data/tracks/ecmascript/exercises/say/package.json +62 -13
- data/tracks/ecmascript/exercises/scrabble-score/package.json +62 -13
- data/tracks/ecmascript/exercises/secret-handshake/package.json +62 -13
- data/tracks/ecmascript/exercises/series/package.json +62 -13
- data/tracks/ecmascript/exercises/sieve/package.json +62 -13
- data/tracks/ecmascript/exercises/simple-cipher/package.json +62 -13
- data/tracks/ecmascript/exercises/space-age/package.json +62 -13
- data/tracks/ecmascript/exercises/strain/package.json +62 -13
- data/tracks/ecmascript/exercises/sum-of-multiples/package.json +62 -13
- data/tracks/ecmascript/exercises/triangle/package.json +62 -13
- data/tracks/ecmascript/exercises/trinary/package.json +62 -13
- data/tracks/ecmascript/exercises/two-bucket/package.json +62 -13
- data/tracks/ecmascript/exercises/word-count/package.json +62 -13
- data/tracks/ecmascript/exercises/wordy/package.json +62 -13
- data/tracks/ecmascript/package.json +62 -13
- data/tracks/erlang/.github/stale.yml +3 -0
- data/tracks/go/exercises/series/asktoomuch_test.go +1 -1
- data/tracks/go/exercises/series/example.go +2 -2
- data/tracks/go/exercises/series/first_example.go +1 -1
- data/tracks/go/exercises/series/first_test.go +1 -1
- data/tracks/go/exercises/series/series_test.go +2 -2
- data/tracks/ocaml/exercises/bracket-push/test.ml +2 -0
- data/tracks/ocaml/exercises/phone-number/example.ml +7 -2
- data/tracks/ocaml/exercises/phone-number/test.ml +11 -5
- data/tracks/ocaml/tools/test-generator/templates/phone-number/template.ml +1 -1
- data/tracks/pony/.github/stale.yml +16 -0
- data/tracks/purescript/config.json +7 -0
- data/tracks/purescript/exercises/pascals-triangle/bower.json +16 -0
- data/tracks/purescript/exercises/pascals-triangle/examples/src/PascalsTriangle.purs +24 -0
- data/tracks/purescript/exercises/pascals-triangle/src/PascalsTriangle.purs +1 -0
- data/tracks/purescript/exercises/pascals-triangle/test/Main.purs +74 -0
- data/tracks/ruby/.github/ISSUE_TEMPLATE.md +2 -2
- data/tracks/ruby/.github/PULL_REQUEST_TEMPLATE.md +14 -10
- data/tracks/ruby/.github/stale.yml +21 -0
- data/tracks/ruby/README.md +80 -74
- data/tracks/ruby/{lib → exercises/acronym/.meta/generator}/acronym_cases.rb +0 -0
- data/tracks/ruby/{lib → exercises/all-your-base/.meta/generator}/all_your_base_cases.rb +0 -0
- data/tracks/ruby/{lib → exercises/alphametics/.meta/generator}/alphametics_cases.rb +0 -0
- data/tracks/ruby/{lib → exercises/anagram/.meta/generator}/anagram_cases.rb +0 -0
- data/tracks/ruby/{lib → exercises/beer-song/.meta/generator}/beer_song_cases.rb +0 -0
- data/tracks/ruby/{lib → exercises/binary/.meta/generator}/binary_cases.rb +0 -0
- data/tracks/ruby/{lib → exercises/bowling/.meta/generator}/bowling_cases.rb +0 -0
- data/tracks/ruby/{lib → exercises/bracket-push/.meta/generator}/bracket_push_cases.rb +0 -0
- data/tracks/ruby/{lib → exercises/clock/.meta/generator}/clock_cases.rb +0 -0
- data/tracks/ruby/{lib → exercises/connect/.meta/generator}/connect_cases.rb +0 -0
- data/tracks/ruby/{lib → exercises/custom-set/.meta/generator}/custom_set_cases.rb +0 -0
- data/tracks/ruby/{lib → exercises/difference-of-squares/.meta/generator}/difference_of_squares_cases.rb +0 -0
- data/tracks/ruby/{lib → exercises/dominoes/.meta/generator}/dominoes_cases.rb +0 -0
- data/tracks/ruby/{lib → exercises/etl/.meta/generator}/etl_cases.rb +0 -0
- data/tracks/ruby/{lib → exercises/gigasecond/.meta/generator}/gigasecond_cases.rb +0 -0
- data/tracks/ruby/{lib → exercises/grains/.meta/generator}/grains_cases.rb +0 -0
- data/tracks/ruby/{lib → exercises/hamming/.meta/generator}/hamming_cases.rb +0 -0
- data/tracks/ruby/{lib → exercises/hello-world/.meta/generator}/hello_world_cases.rb +0 -0
- data/tracks/ruby/{lib → exercises/isogram/.meta/generator}/isogram_cases.rb +0 -0
- data/tracks/ruby/{lib → exercises/largest-series-product/.meta/generator}/largest_series_product_cases.rb +0 -0
- data/tracks/ruby/{lib → exercises/leap/.meta/generator}/leap_cases.rb +0 -0
- data/tracks/ruby/{lib → exercises/luhn/.meta/generator}/luhn_cases.rb +0 -0
- data/tracks/ruby/{lib → exercises/nth-prime/.meta/generator}/nth_prime_cases.rb +0 -0
- data/tracks/ruby/{lib → exercises/ocr-numbers/.meta/generator}/ocr_numbers_cases.rb +0 -0
- data/tracks/ruby/{lib → exercises/pangram/.meta/generator}/pangram_cases.rb +0 -0
- data/tracks/ruby/{lib → exercises/pig-latin/.meta/generator}/pig_latin_cases.rb +0 -0
- data/tracks/ruby/{lib → exercises/queen-attack/.meta/generator}/queen_attack_cases.rb +0 -0
- data/tracks/ruby/{lib → exercises/raindrops/.meta/generator}/raindrops_cases.rb +0 -0
- data/tracks/ruby/{lib → exercises/rna-transcription/.meta/generator}/rna_transcription_cases.rb +0 -0
- data/tracks/ruby/{lib → exercises/roman-numerals/.meta/generator}/roman_numerals_cases.rb +0 -0
- data/tracks/ruby/{lib → exercises/run-length-encoding/.meta/generator}/run_length_encoding_cases.rb +0 -0
- data/tracks/ruby/{lib → exercises/say/.meta/generator}/say_cases.rb +0 -0
- data/tracks/ruby/{lib → exercises/sieve/.meta/generator}/sieve_cases.rb +0 -0
- data/tracks/ruby/{lib → exercises/tournament/.meta/generator}/tournament_cases.rb +0 -0
- data/tracks/ruby/{lib → exercises/transpose/.meta/generator}/transpose_cases.rb +0 -0
- data/tracks/ruby/{lib → exercises/triangle/.meta/generator}/triangle_cases.rb +0 -0
- data/tracks/ruby/{lib → exercises/two-bucket/.meta/generator}/two_bucket_cases.rb +0 -0
- data/tracks/ruby/{lib → exercises/word-count/.meta/generator}/word_count_cases.rb +0 -0
- data/tracks/ruby/{lib → exercises/wordy/.meta/generator}/wordy_cases.rb +0 -0
- data/tracks/ruby/lib/generator/files.rb +5 -1
- data/tracks/ruby/lib/generator/files/generator_cases.rb +18 -4
- data/tracks/ruby/lib/generator/files/metadata_files.rb +3 -0
- data/tracks/ruby/lib/generator/files/track_files.rb +24 -6
- data/tracks/ruby/test/fixtures/xruby/exercises/alpha/.meta/generator/test_template.erb +23 -0
- data/tracks/ruby/test/fixtures/xruby/exercises/beta/.meta/.version +1 -0
- data/tracks/ruby/test/fixtures/xruby/{lib → exercises/beta/.meta/generator}/beta_cases.rb +0 -0
- data/tracks/ruby/test/fixtures/xruby/exercises/beta/example.rb +5 -0
- data/tracks/ruby/test/fixtures/xruby/exercises/{alpha → beta}/example.tt +10 -7
- data/tracks/ruby/test/generator/files/generate_cases_test.rb +25 -1
- data/tracks/ruby/test/generator/files/metadata_files_test.rb +21 -0
- data/tracks/ruby/test/generator/files/track_files_test.rb +20 -3
- data/tracks/ruby/test/generator/files_test.rb +18 -0
- data/tracks/ruby/test/wordy_cases_test.rb +1 -0
- data/tracks/typescript/README.md +1 -1
- data/tracks/typescript/config.json +6 -0
- data/tracks/typescript/exercises/difference-of-squares/difference-of-squares.example.ts +39 -0
- data/tracks/typescript/exercises/difference-of-squares/difference-of-squares.test.ts +56 -0
- data/tracks/typescript/exercises/difference-of-squares/package.json +36 -0
- data/tracks/typescript/exercises/difference-of-squares/tsconfig.json +21 -0
- data/tracks/typescript/exercises/difference-of-squares/tslint.json +127 -0
- data/tracks/typescript/exercises/difference-of-squares/yarn.lock +2739 -0
- data/tracks/typescript/exercises/wordy/wordy.example.ts +1 -1
- metadata +56 -114
- data/tracks/csharp/.github/stale.yml +0 -0
- data/tracks/ecmascript/exercises/accumulate/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/acronym/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/all-your-base/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/allergies/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/anagram/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/atbash-cipher/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/beer-song/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/binary-search-tree/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/binary-search/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/binary/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/bob/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/bracket-push/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/circular-buffer/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/clock/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/crypto-square/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/custom-set/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/diamond/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/difference-of-squares/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/etl/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/food-chain/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/gigasecond/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/grade-school/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/grains/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/gulpfile.js +0 -89
- data/tracks/ecmascript/exercises/hamming/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/hello-world/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/hexadecimal/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/isogram/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/kindergarten-garden/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/largest-series-product/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/leap/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/linked-list/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/luhn/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/matrix/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/meetup/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/nth-prime/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/ocr-numbers/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/octal/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/palindrome-products/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/palindrome-products/palindrome-products.js +0 -18
- data/tracks/ecmascript/exercises/pangram/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/pascals-triangle/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/perfect-numbers/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/phone-number/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/pig-latin/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/prime-factors/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/pythagorean-triplet/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/queen-attack/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/raindrops/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/rna-transcription/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/robot-name/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/robot-simulator/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/roman-numerals/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/saddle-points/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/say/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/scrabble-score/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/secret-handshake/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/series/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/sieve/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/simple-cipher/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/space-age/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/strain/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/sum-of-multiples/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/triangle/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/trinary/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/two-bucket/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/word-count/gulpfile.js +0 -92
- data/tracks/ecmascript/exercises/wordy/gulpfile.js +0 -92
- data/tracks/ecmascript/gulpfile.js +0 -92
- data/tracks/fsharp/.github/stale.yml +0 -0
@@ -1,12 +1,15 @@
|
|
1
|
-
<!---
|
1
|
+
<!--- This template is meant to help develop good habits in creating PRs. -->
|
2
|
+
<!--- Feel free to delete it if you don't find it useful. -->
|
2
3
|
|
3
|
-
|
4
|
-
<!--- Describe your changes in detail -->
|
4
|
+
<!--- Provide a general summary of your changes in the Title above -->
|
5
5
|
|
6
|
-
##
|
6
|
+
## Why?
|
7
7
|
<!--- Why is this change required? What problem does it solve? -->
|
8
8
|
<!--- If it fixes an open issue, please link to the issue here. -->
|
9
9
|
|
10
|
+
## What?
|
11
|
+
<!--- Describe your changes in detail -->
|
12
|
+
|
10
13
|
## How Has This Been Tested?
|
11
14
|
<!--- Please describe in detail how you tested your changes. -->
|
12
15
|
<!--- Include details of your testing environment, and the tests you ran to -->
|
@@ -17,20 +20,21 @@
|
|
17
20
|
## Types of changes
|
18
21
|
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
|
19
22
|
- [ ] Bug fix (non-breaking change which fixes an issue)
|
20
|
-
- [ ]
|
21
|
-
- [ ] Breaking change (fix or
|
23
|
+
- [ ] Enhancement (non-breaking change which adds functionality)
|
24
|
+
- [ ] Breaking change (fix or enhancement that would cause existing functionality to change)
|
25
|
+
- [ ] Gardening (code and/or documentation cleanup)
|
22
26
|
|
23
27
|
## References and Closures
|
24
|
-
|
25
|
-
<!---
|
28
|
+
<!--- not previously mentioned -->
|
29
|
+
<!--- references #000 -->
|
26
30
|
<!--- closes #000 -->
|
27
31
|
|
28
32
|
## Checklist:
|
29
33
|
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
|
30
34
|
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
|
31
|
-
- [ ]
|
35
|
+
- [ ] I have read the **CONTRIBUTING** document.
|
32
36
|
- [ ] My change relies on a pending issue/pull request
|
37
|
+
- [ ] My change requires a change to the documentation.
|
33
38
|
- [ ] I have updated the documentation accordingly.
|
34
|
-
- [ ] I have read the **CONTRIBUTING** document.
|
35
39
|
- [ ] I have added tests to cover my changes.
|
36
40
|
- [ ] All new and existing tests passed.
|
@@ -0,0 +1,21 @@
|
|
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
|
+
- security
|
11
|
+
# Label to use when marking as stale
|
12
|
+
staleLabel: stale
|
13
|
+
# Comment to post when marking as stale. Set to `false` to disable
|
14
|
+
markComment: >
|
15
|
+
This issue has been automatically marked as stale because it has not had
|
16
|
+
recent activity. It will be closed if no further activity occurs. Thank you
|
17
|
+
for your contributions.
|
18
|
+
# Comment to post when closing a stale Issue or Pull Request. Set to `false` to disable
|
19
|
+
closeComment: false
|
20
|
+
# Limit to only `issues` or `pulls`
|
21
|
+
# only: issues
|
data/tracks/ruby/README.md
CHANGED
@@ -7,40 +7,27 @@ Exercism Exercises in Ruby
|
|
7
7
|
|
8
8
|
## Setup
|
9
9
|
|
10
|
-
You'll need a recent (2.1+) version of Ruby, but that's it. Minitest
|
11
|
-
|
12
|
-
with the language, so you're all set.
|
10
|
+
You'll need a recent (2.1+) version of Ruby, but that's it. Minitest ships with
|
11
|
+
the language, so you're all set.
|
13
12
|
|
14
|
-
##
|
13
|
+
## Anatomy of an Exercise
|
15
14
|
|
16
|
-
|
17
|
-
|
15
|
+
The files for an exercise live in `exercises/<exercise_name>` (where
|
16
|
+
`<exercise_name>` is the slug for the exercise, e.g. `clock` or
|
17
|
+
`atbash-cipher`). An exercise has a test suite
|
18
|
+
(`exercises/<exercise_name>/<exercise_name>_test.rb`) and an example solution
|
19
|
+
(`exercises/<exercise_name>/example.rb`).
|
18
20
|
|
19
|
-
**
|
20
|
-
[Generated Test Suites](#generated-test-suites) below.**
|
21
|
-
|
22
|
-
|
21
|
+
**Most exercises can be generated from shared inputs/outputs, called canonical
|
22
|
+
data (see [Generated Test Suites](#generated-test-suites) below).** To find out
|
23
|
+
whether a test has canonical data, check
|
24
|
+
the [x-common repo](https://github.com/exercism/x-common/tree/master/exercises).
|
23
25
|
|
24
|
-
|
26
|
+
## Running the Tests
|
25
27
|
|
26
|
-
Run the
|
27
|
-
|
28
|
-
|
29
|
-
to not overwhelm people with errors.
|
30
|
-
|
31
|
-
If you want to temporarily disable the skips while working on a test
|
32
|
-
suite, you can run the file with a shim that temporarily disables them:
|
33
|
-
|
34
|
-
```sh
|
35
|
-
ruby -I./lib -rdisable_skip exercise/exercise/filename_test.rb
|
36
|
-
```
|
37
|
-
|
38
|
-
It is simpler to use the `rake` tool which is available in the project
|
39
|
-
root. It will disable the skip calls for you automatically, it does the
|
40
|
-
same thing as the above.
|
41
|
-
|
42
|
-
If you would like to use the `rake` tool to run a single test while
|
43
|
-
developing clock, for example, you can do something like this:
|
28
|
+
Run the tests using `rake`, rather than `ruby path/to/the_test.rb`. `rake`
|
29
|
+
knows to look for `example.rb` and to disable skips. Just tell `rake` the
|
30
|
+
name of your problem and you are set:
|
44
31
|
|
45
32
|
```sh
|
46
33
|
rake test:clock
|
@@ -52,8 +39,10 @@ the following:
|
|
52
39
|
rake test:clock -- -p
|
53
40
|
```
|
54
41
|
|
55
|
-
To
|
56
|
-
|
42
|
+
To run a subset of the tests, use a regular expression. For example, if tests
|
43
|
+
exist taht are named identical_to_4_places, and identical, then we can run both
|
44
|
+
tests with
|
45
|
+
|
57
46
|
```sh
|
58
47
|
rake test:hamming -- -p -n="/identical/"
|
59
48
|
```
|
@@ -64,15 +53,20 @@ Note that flags which have an attached value, like above, must take the form
|
|
64
53
|
|
65
54
|
### Generated Test Suites
|
66
55
|
|
67
|
-
|
68
|
-
|
69
|
-
|
56
|
+
Generated test suites use the `bin/generator` cli.
|
57
|
+
|
58
|
+
While many of the exercises which have canonical data already have generators,
|
59
|
+
some do not. To find out whether an exercise has a generator, run
|
70
60
|
|
71
|
-
|
61
|
+
bin/generate -h
|
62
|
+
|
63
|
+
In addition to a usage message, the `-h` flag lists all exercises with a
|
64
|
+
generator. If a generator is available for your exercise, you can
|
72
65
|
|
73
66
|
* [Regenerate the test suite](#regenerating-an-exercise) based on updated canonical data
|
74
67
|
* [Make changes to a generated exercise](#changing-a-generated-exercise)
|
75
|
-
|
68
|
+
|
69
|
+
If not, you will need to [implement a new generator](#implementing-a-generator)
|
76
70
|
|
77
71
|
Generated exercises depend on the [the shared metadata][x-common], which must be
|
78
72
|
cloned to the same directory that contains your clone of the xruby repository:
|
@@ -83,52 +77,56 @@ tree -L 1 ~/code/exercism
|
|
83
77
|
└── xruby
|
84
78
|
```
|
85
79
|
|
86
|
-
#### Regenerating
|
80
|
+
#### Regenerating a Test Suite
|
87
81
|
|
88
|
-
From within the xruby directory, run the following command
|
89
|
-
of the exercise, e.g. `clock` or `atbash-cipher`:
|
82
|
+
From within the xruby directory, run the following command:
|
90
83
|
|
91
84
|
```
|
92
|
-
bin/generate
|
85
|
+
bin/generate <exercise_name>
|
93
86
|
```
|
94
87
|
|
95
88
|
#### Changing a Generated Exercise
|
96
89
|
|
97
|
-
Do not edit
|
98
|
-
|
90
|
+
Do not edit `<exercise_name>/<exercise_name>_test.rb`. Any changes you make will
|
91
|
+
be overwritten when the test suite is regenerated.
|
99
92
|
|
100
93
|
There are two reasons why a test suite might change:
|
101
94
|
|
102
|
-
1. the tests
|
95
|
+
1. the tests need to change (an incorrect expectation, a missing edge case, etc)
|
103
96
|
1. there might be issues with the style or boilerplate
|
104
97
|
|
105
98
|
In the first case, the changes need to be made to the `canonical-data.json` file for
|
106
99
|
the exercise, which lives in the x-common repository.
|
107
100
|
|
108
101
|
```
|
109
|
-
../x-common/exercises
|
102
|
+
../x-common/exercises/<exercise_name>/
|
110
103
|
├── canonical-data.json
|
111
104
|
├── description.md
|
112
105
|
└── metadata.yml
|
113
106
|
```
|
114
107
|
|
115
|
-
This change will need to be submitted as a pull request to the x-common
|
116
|
-
request needs to be merged before you can regenerate the
|
108
|
+
This change will need to be submitted as a pull request to the x-common
|
109
|
+
repository. This pull request needs to be merged before you can regenerate the
|
110
|
+
exercise.
|
117
111
|
|
118
112
|
Changes that don't have to do directly with the test inputs and outputs should
|
119
|
-
be made to
|
120
|
-
|
113
|
+
be made to the exercise's test case generator, discussed
|
114
|
+
in [implementing a new generator](#implementing-a-generator), next. Then you
|
115
|
+
can regenerate the exercise with `bin/generate <exercise_name>`.
|
121
116
|
|
122
117
|
#### Implementing a Generator
|
123
118
|
|
124
|
-
|
125
|
-
|
119
|
+
An exercise's test case generator class produces the code that goes inside
|
120
|
+
the minitest `test_<whatever>` methods. An exercise's generator lives in
|
121
|
+
`exercises/<exercise_name>/.meta/generator/<exercise_name>_cases.rb`.
|
126
122
|
|
127
|
-
|
128
|
-
|
123
|
+
The test case generator is a derived class of `ExerciseCase` (in
|
124
|
+
`lib/generator/exercise_cases.rb`). `ExerciseCase` does most of the work of
|
125
|
+
extracting the canonical data. The derived class wraps the JSON for a single
|
126
|
+
test case. The default version looks something like this:
|
129
127
|
|
130
128
|
```
|
131
|
-
class
|
129
|
+
class <ExerciseName>Case < ExerciseCase
|
132
130
|
|
133
131
|
def workload
|
134
132
|
# Example workload:
|
@@ -138,31 +136,36 @@ class ProblemNameCase < ExerciseCase
|
|
138
136
|
end
|
139
137
|
```
|
140
138
|
|
141
|
-
|
142
|
-
the generator script will infer the name of the class from the
|
139
|
+
where `<ExerciseName>` is the <exercise_name> slug in CamelCase. This is
|
140
|
+
important, since the generator script will infer the name of the class from the
|
141
|
+
<exercise_name> slug.
|
143
142
|
|
144
|
-
This class must provide the methods used by
|
145
|
-
|
143
|
+
This class must provide the methods used by the test
|
144
|
+
template. A
|
145
|
+
[default template](https://github.com/exercism/xruby/blob/master/lib/generator/test_template.erb) that
|
146
|
+
most exercises can (and do) use lives in `lib/generator/test_template.erb`. The
|
147
|
+
base class provides methods for the default template for everything except
|
148
|
+
`#workload`.
|
146
149
|
|
147
|
-
|
150
|
+
`#workload` generates the code for the body of a test, including the assertion
|
148
151
|
and any setup required. The base class provides a variety of assertion and
|
149
152
|
helper methods. Beyond that, you can implement any helper methods that you need
|
150
|
-
as private methods in your derived class. See below for more information
|
151
|
-
|
152
|
-
If you really must add additional logic to the view template, you can use a custom
|
153
|
-
template. Copy `lib/generator/test_template.erb` to your exercise directory, name it
|
154
|
-
`exercise.tt`, and customize.
|
153
|
+
as private methods in your derived class. See below for more information
|
154
|
+
about [the intention of #workload](#workload-philosophy)
|
155
155
|
|
156
|
-
You
|
156
|
+
You don't have to do anything other than implement `#workload` to use the default
|
157
|
+
template.
|
157
158
|
|
158
|
-
|
159
|
-
|
159
|
+
If you really must add additional logic to the view template, you can use a
|
160
|
+
custom template. Copy `lib/generator/test_template.erb` to
|
161
|
+
`.meta/generator/test_template.erb` under your exercise directory and
|
162
|
+
customize. You may need to create `.meta` and/or `.meta/generator`.
|
160
163
|
|
161
164
|
|
162
|
-
|
165
|
+
#### Workload philosophy.
|
163
166
|
|
164
167
|
Prioritize educational value over expert comprehension and make sure that
|
165
|
-
things are clear to people who may not be familiar with Minitest and even Ruby.
|
168
|
+
things are clear to people who may not be familiar with Minitest and even Ruby.
|
166
169
|
|
167
170
|
Provide the information the student needs to derive the code to pass the test
|
168
171
|
in a clear and consistent manner. Illustrate the purpose of the individual
|
@@ -215,18 +218,21 @@ appropriately.
|
|
215
218
|
|
216
219
|
For more complete information, see [Rubocop](http://batsov.com/rubocop/).
|
217
220
|
|
218
|
-
|
221
|
+
While `lib/generator/exercise_cases.rb` provides helper functions as discussed
|
222
|
+
above, it remains the responsibility of an exercise's generator to interpret its
|
223
|
+
canonical-data.json data in a stylistically correct manner, e.g. converting
|
224
|
+
string indices to integer indices.
|
219
225
|
|
220
226
|
## READMEs
|
221
227
|
|
222
|
-
|
223
|
-
|
224
|
-
[exercism/x-common](https://github.com/exercism/x-common) repository.
|
228
|
+
Do not add a README or README.md file to the exercise's directory. The READMEs
|
229
|
+
are constructed using shared metadata, which lives in the [x-common][] repo.
|
225
230
|
|
226
231
|
## Contributing Guide
|
227
232
|
|
228
|
-
For an in-depth discussion of how exercism language tracks and
|
229
|
-
|
233
|
+
For an in-depth discussion of how exercism language tracks and exercises work,
|
234
|
+
please see the
|
235
|
+
[contributing guide](https://github.com/exercism/x-api/blob/master/CONTRIBUTING.md#the-exercise-data)
|
230
236
|
|
231
237
|
## License
|
232
238
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/tracks/ruby/{lib → exercises/rna-transcription/.meta/generator}/rna_transcription_cases.rb
RENAMED
File without changes
|
File without changes
|
data/tracks/ruby/{lib → exercises/run-length-encoding/.meta/generator}/run_length_encoding_cases.rb
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -2,6 +2,10 @@ require 'pathname'
|
|
2
2
|
|
3
3
|
module Generator
|
4
4
|
module Files
|
5
|
+
def self.read(filename)
|
6
|
+
File.read(filename) if File.exist?(filename)
|
7
|
+
end
|
8
|
+
|
5
9
|
class Readable
|
6
10
|
attr_reader :filename, :repository_root
|
7
11
|
def initialize(filename:, repository_root: nil)
|
@@ -10,7 +14,7 @@ module Generator
|
|
10
14
|
end
|
11
15
|
|
12
16
|
def to_s
|
13
|
-
|
17
|
+
Files.read(filename)
|
14
18
|
end
|
15
19
|
|
16
20
|
def abbreviated_commit_hash
|
@@ -4,8 +4,8 @@ module Generator
|
|
4
4
|
module_function
|
5
5
|
|
6
6
|
def available(track_path)
|
7
|
-
generator_glob = File.join(track_path,
|
8
|
-
Dir
|
7
|
+
generator_glob = File.join(track_path, "{lib,exercises}", '**', '*_cases.rb')
|
8
|
+
Dir.glob(generator_glob, File::FNM_DOTMATCH).sort.map { |filename| exercise_name(filename) }
|
9
9
|
end
|
10
10
|
|
11
11
|
def filename(exercise_name)
|
@@ -20,9 +20,23 @@ module Generator
|
|
20
20
|
%r{([^/]*)_cases\.rb$}.match(filename).captures[0].tr('_', '-')
|
21
21
|
end
|
22
22
|
|
23
|
+
# temporary, when we've moved everything, move contents of cases_filename
|
24
|
+
# to this method
|
23
25
|
def load_filename(track_path, exercise_name)
|
24
|
-
|
25
|
-
|
26
|
+
File.exist?(cases_filename(track_path, exercise_name)) ?
|
27
|
+
cases_filename(track_path, exercise_name) :
|
28
|
+
legacy_cases_filename(track_path, exercise_name)
|
29
|
+
end
|
30
|
+
|
31
|
+
# this becomes load_filename
|
32
|
+
def cases_filename(track_path, exercise_name)
|
33
|
+
"%s.rb" % File.join(track_path, 'exercises', exercise_name, '.meta', 'generator',
|
34
|
+
filename(exercise_name))
|
35
|
+
end
|
36
|
+
|
37
|
+
# this goes away
|
38
|
+
def legacy_cases_filename(track_path, exercise_name)
|
39
|
+
"%s.rb" % File.join(track_path, 'lib', filename(exercise_name))
|
26
40
|
end
|
27
41
|
end
|
28
42
|
end
|