trackler 2.2.1.35 → 2.2.1.36

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/lib/trackler/version.rb +1 -1
  3. data/tracks/c/exercises/all-your-base/test/test_all_your_base.c +5 -5
  4. data/tracks/clojure/config.json +10 -0
  5. data/tracks/clojure/exercises/series/README.md +28 -0
  6. data/tracks/clojure/exercises/series/project.clj +4 -0
  7. data/tracks/clojure/exercises/series/src/example.clj +9 -0
  8. data/tracks/clojure/exercises/series/src/series.clj +3 -0
  9. data/tracks/clojure/exercises/series/test/series_test.clj +23 -0
  10. data/tracks/coldfusion/README.md +2 -2
  11. data/tracks/coldfusion/config.json +28 -11
  12. data/tracks/coldfusion/docs/EXERCISE_README_INSERT.md +1 -1
  13. data/tracks/coldfusion/docs/TESTS.md +1 -1
  14. data/tracks/coldfusion/exercises/bob/.meta/HINTS.md +0 -0
  15. data/tracks/coldfusion/exercises/bob/Bob.cfc +13 -0
  16. data/tracks/coldfusion/exercises/bob/BobTest.cfc +115 -0
  17. data/tracks/coldfusion/exercises/bob/Solution.cfc +27 -0
  18. data/tracks/coldfusion/exercises/bob/SolutionTest.cfc +7 -0
  19. data/tracks/coldfusion/exercises/bob/TestRunner.cfc +103 -0
  20. data/tracks/coldfusion/exercises/bob/box.json +8 -0
  21. data/tracks/coldfusion/exercises/bob/index.cfm +37 -0
  22. data/tracks/coldfusion/exercises/word-count/.meta/HINTS.md +0 -0
  23. data/tracks/coldfusion/exercises/word-count/Solution.cfc +22 -0
  24. data/tracks/coldfusion/exercises/word-count/SolutionTest.cfc +7 -0
  25. data/tracks/coldfusion/exercises/word-count/TestRunner.cfc +103 -0
  26. data/tracks/coldfusion/exercises/word-count/WordCount.cfc +13 -0
  27. data/tracks/coldfusion/exercises/word-count/WordCountTest.cfc +55 -0
  28. data/tracks/coldfusion/exercises/word-count/box.json +8 -0
  29. data/tracks/coldfusion/exercises/word-count/index.cfm +37 -0
  30. data/tracks/coldfusion/tasks/ScaffoldExercise.cfc +1 -1
  31. data/tracks/coldfusion/tasks/TestAllSolutions.cfc +1 -1
  32. data/tracks/haskell/config.json +9 -0
  33. data/tracks/haskell/exercises/isogram/README.md +73 -0
  34. data/tracks/haskell/exercises/isogram/examples/success-standard/package.yaml +16 -0
  35. data/tracks/haskell/exercises/isogram/examples/success-standard/src/Isogram.hs +7 -0
  36. data/tracks/haskell/exercises/isogram/package.yaml +20 -0
  37. data/tracks/haskell/exercises/isogram/src/Isogram.hs +4 -0
  38. data/tracks/haskell/exercises/isogram/stack.yaml +1 -0
  39. data/tracks/haskell/exercises/isogram/test/Tests.hs +63 -0
  40. data/tracks/typescript/Makefile +15 -4
  41. data/tracks/typescript/common/package.json +1 -1
  42. data/tracks/typescript/exercises/acronym/package.json +1 -1
  43. data/tracks/typescript/exercises/anagram/anagram.ts +0 -0
  44. data/tracks/typescript/exercises/anagram/package.json +1 -1
  45. data/tracks/typescript/exercises/beer-song/beer-song.ts +0 -0
  46. data/tracks/typescript/exercises/beer-song/package.json +1 -1
  47. data/tracks/typescript/exercises/bob/bob.ts +0 -0
  48. data/tracks/typescript/exercises/bob/package.json +1 -1
  49. data/tracks/typescript/exercises/difference-of-squares/difference-of-squares.ts +0 -0
  50. data/tracks/typescript/exercises/difference-of-squares/package.json +1 -1
  51. data/tracks/typescript/exercises/etl/etl.ts +0 -0
  52. data/tracks/typescript/exercises/etl/package.json +1 -1
  53. data/tracks/typescript/exercises/food-chain/food-chain.ts +0 -0
  54. data/tracks/typescript/exercises/food-chain/package.json +1 -1
  55. data/tracks/typescript/exercises/gigasecond/gigasecond.ts +0 -0
  56. data/tracks/typescript/exercises/gigasecond/package.json +1 -1
  57. data/tracks/typescript/exercises/grade-school/grade-school.ts +0 -0
  58. data/tracks/typescript/exercises/grade-school/package.json +1 -1
  59. data/tracks/typescript/exercises/hamming/hamming.ts +0 -0
  60. data/tracks/typescript/exercises/hamming/package.json +1 -1
  61. data/tracks/typescript/exercises/hello-world/hello-world.ts +0 -0
  62. data/tracks/typescript/exercises/hello-world/package.json +1 -1
  63. data/tracks/typescript/exercises/leap/leap.ts +0 -0
  64. data/tracks/typescript/exercises/leap/package.json +1 -1
  65. data/tracks/typescript/exercises/pangram/package.json +1 -1
  66. data/tracks/typescript/exercises/pangram/pangram.ts +0 -0
  67. data/tracks/typescript/exercises/phone-number/package.json +1 -1
  68. data/tracks/typescript/exercises/phone-number/phone-number.ts +0 -0
  69. data/tracks/typescript/exercises/raindrops/package.json +1 -1
  70. data/tracks/typescript/exercises/raindrops/raindrops.ts +0 -0
  71. data/tracks/typescript/exercises/rna-transcription/package.json +1 -1
  72. data/tracks/typescript/exercises/rna-transcription/rna-transcription.ts +0 -0
  73. data/tracks/typescript/exercises/robot-name/package.json +1 -1
  74. data/tracks/typescript/exercises/robot-name/robot-name.ts +0 -0
  75. data/tracks/typescript/exercises/say/package.json +1 -1
  76. data/tracks/typescript/exercises/say/say.ts +0 -0
  77. data/tracks/typescript/exercises/scrabble-score/package.json +1 -1
  78. data/tracks/typescript/exercises/scrabble-score/scrabble-score.ts +0 -0
  79. data/tracks/typescript/exercises/space-age/package.json +1 -1
  80. data/tracks/typescript/exercises/space-age/space-age.ts +0 -0
  81. data/tracks/typescript/exercises/word-count/package.json +1 -1
  82. data/tracks/typescript/exercises/word-count/word-count.ts +0 -0
  83. data/tracks/typescript/exercises/wordy/package.json +1 -1
  84. data/tracks/typescript/exercises/wordy/wordy.ts +0 -0
  85. metadata +51 -2
@@ -0,0 +1,8 @@
1
+ {
2
+ "dependencies":{
3
+ "testbox":"^2.5.0+107"
4
+ },
5
+ "installPaths":{
6
+ "testbox":"testbox"
7
+ }
8
+ }
@@ -0,0 +1,37 @@
1
+ <!---
2
+
3
+ This file will only be used if you want to start up a web server in this directory. You can do so by running:
4
+
5
+ $> box
6
+ CommandBox> install
7
+ CommandBox> server start
8
+
9
+ However, this is not necessary unless you really just want to use the HTML reporters on TestBox.
10
+ Ideally, you'll skip the need for this file entirely and just run the tests directly frm the CLI like this:
11
+
12
+ CommandBox> task run TestRunner
13
+
14
+ --->
15
+ <cfsetting showDebugOutput="false">
16
+ <cfparam name="url.reporter" default="simple">
17
+ <cfscript>
18
+ // get a list of all CFCs in this folder whose name looks like "XXXTest.cfc"
19
+ // And turn it into compnent path relative to the web root
20
+ url.bundles = directoryList(
21
+ path=expandPath( '/' ),
22
+ filter='*Test.cfc' )
23
+ .map( function( path ) {
24
+ return path
25
+ .replaceNoCase( expandPath( '/' ), '' )
26
+ .left( -4 )
27
+ } )
28
+ .toList();
29
+ </cfscript>
30
+
31
+ <!--- Ensure TestBox --->
32
+ <cfif fileExists( "/testbox/system/runners/HTMLRunner.cfm" )>
33
+ <!--- Include the TestBox HTML Runner --->
34
+ <cfinclude template="/testbox/system/runners/HTMLRunner.cfm">
35
+ <cfelse>
36
+ Oops, you don't have TestBox installed yet! Please run <b>box install</b> from the root of your excercise folder and refresh this page.
37
+ </cfif>
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Here is an example solution for the WordCount exercise
3
+ */
4
+ component {
5
+
6
+ function countwords( input ) {
7
+ return input
8
+ // Strip out chars we don't care about
9
+ .reReplaceNoCase( '[^a-z0-9'' ]', '', 'all' )
10
+ // Break string into array
11
+ .listToArray( ' ' )
12
+ // Reduce arary into struct of word counts
13
+ .reduce( function( wordStats, word ){
14
+ // Clean quoted words
15
+ word = word.reReplaceNocase( "^'(.*)'$", "\1" );
16
+ // Aggregate word counts
17
+ wordStats[ word ] = ( wordStats[ word ] ?: 0 ) + 1;
18
+ return wordStats;
19
+ }, {} );
20
+ }
21
+
22
+ }
@@ -0,0 +1,7 @@
1
+ component extends="WordCountTest" {
2
+
3
+ function beforeAll(){
4
+ SUT = createObject( 'Solution' );
5
+ }
6
+
7
+ }
@@ -0,0 +1,103 @@
1
+ /**
2
+ * I am a CommandBox task runner which you can use to test your implementation of this exercise against the
3
+ * provided test suite. To use me, open the CommandBox CLI and run this:
4
+ *
5
+ * CommandBox> task run TestRunner
6
+ *
7
+ * To start up a test watcher that will automatically rerun the test suite every time you save a file change, run this:
8
+ *
9
+ * CommandBox> task run TestRunner --watcher
10
+ *
11
+ */
12
+ component {
13
+
14
+ /**
15
+ * @solution Runs the tests against the solution
16
+ * @watcher Start up a file watch that re-runs the tests on file changes. Use Ctrl-C to stop
17
+ */
18
+ function run( boolean solution=false, boolean watcher=false ) {
19
+
20
+ ensureTestBox();
21
+
22
+ if( watcher ) {
23
+
24
+ // Tabula rasa
25
+ command( 'cls' ).run();
26
+
27
+ // Start watcher
28
+ watch()
29
+ .paths( '*.cfc' )
30
+ .inDirectory( getCWD() )
31
+ .withDelay( 500 )
32
+ .onChange( function() {
33
+
34
+ // Clear the screen
35
+ command( 'cls' )
36
+ .run();
37
+
38
+ // This is neccessary so changes to tests get picked up right away.
39
+ pagePoolClear();
40
+
41
+ runTests( solution );
42
+
43
+ } )
44
+ .start();
45
+
46
+ } else {
47
+ runTests( solution );
48
+ }
49
+
50
+ }
51
+
52
+ /**
53
+ * Make sure the TestBox framework is installed
54
+ */
55
+ private function ensureTestBox() {
56
+ var excerciseRoot = getCWD();
57
+ var testBoxRoot = excerciseRoot & '/testbox';
58
+
59
+ if( !directoryExists( testBoxRoot ) ) {
60
+
61
+ print.boldYellowLine( 'Installing some missing dependencies for you!' ).toConsole();
62
+ command( 'install' )
63
+ .inWorkingDirectory( excerciseRoot )
64
+ .run();
65
+ }
66
+
67
+ // Bootstrap TestBox framework
68
+ filesystemUtil.createMapping( '/testbox', testBoxRoot );
69
+ }
70
+
71
+ /**
72
+ * Invoke TestBox to run the test suite
73
+ */
74
+ private function runTests( boolean solution=false ) {
75
+
76
+ // Create TestBox and run the tests
77
+ testData = new testbox.system.TestBox()
78
+ .runRaw( directory = {
79
+ // Find all CFCs...
80
+ mapping = filesystemUtil.makePathRelative( getCWD() ),
81
+ // ... in this directory ...
82
+ recurse = false,
83
+ // ... whose name ends in "test"
84
+ filter = function( path ) {
85
+ return path.reFind( ( solution ? 'Solution' : '' ) & 'Test.cfc$' );
86
+ }
87
+ } )
88
+ .getMemento();
89
+
90
+ // Print out the results with ANSI formatting for the CLI
91
+ getInstance( 'CLIRenderer@testbox-commands' )
92
+ .render( print, testData, true );
93
+
94
+ print.toConsole();
95
+
96
+ // Set proper exit code
97
+ if( testData.totalFail || testData.totalError ) {
98
+ setExitCode( 1 );
99
+ }
100
+ }
101
+
102
+ }
103
+
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Your implmentation of the WordCount exercise
3
+ */
4
+ component {
5
+
6
+ /**
7
+ * @returns
8
+ */
9
+ function countwords( input ) {
10
+ // Implement me here
11
+ }
12
+
13
+ }
@@ -0,0 +1,55 @@
1
+ component extends="testbox.system.BaseSpec" {
2
+
3
+ function beforeAll(){
4
+ SUT = createObject( 'WordCount' );
5
+ }
6
+
7
+ function run(){
8
+
9
+ describe( "My WordCount class", function(){
10
+
11
+ it( 'count one word', function(){
12
+ expect( SUT.countwords( input='word' ) ).toBe( {"word":1} );
13
+ });
14
+
15
+ it( 'count one of each word', function(){
16
+ expect( SUT.countwords( input='one of each' ) ).toBe( {"one":1,"of":1,"each":1} );
17
+ });
18
+
19
+ it( 'multiple occurrences of a word', function(){
20
+ expect( SUT.countwords( input='one fish two fish red fish blue fish' ) ).toBe( {"one":1,"fish":4,"two":1,"red":1,"blue":1} );
21
+ });
22
+
23
+ it( 'handles cramped lists', function(){
24
+ expect( SUT.countwords( input='one, two, three' ) ).toBe( {"one":1,"two":1,"three":1} );
25
+ });
26
+
27
+ it( 'handles expanded lists', function(){
28
+ expect( SUT.countwords( input='one, #chr( 10 )#two, #chr( 10 )#three' ) ).toBe( {"one":1,"two":1,"three":1} );
29
+ });
30
+
31
+ it( 'ignore punctuation', function(){
32
+ expect( SUT.countwords( input='car: carpet as java: javascript!!&@$%^&' ) ).toBe( {"car":1,"carpet":1,"as":1,"java":1,"javascript":1} );
33
+ });
34
+
35
+ it( 'include numbers', function(){
36
+ expect( SUT.countwords( input='testing, 1, 2 testing' ) ).toBe( {"testing":2,"1":1,"2":1} );
37
+ });
38
+
39
+ it( 'normalize case', function(){
40
+ expect( SUT.countwords( input='go Go GO Stop stop' ) ).toBe( {"go":3,"stop":2} );
41
+ });
42
+
43
+ it( 'with apostrophes', function(){
44
+ expect( SUT.countwords( input='First: don''t laugh. Then: don''t cry.' ) ).toBe( {"first":1,"don't":2,"laugh":1,"then":1,"cry":1} );
45
+ });
46
+
47
+ it( 'with quotations', function(){
48
+ expect( SUT.countwords( input='Joe can''t tell between ''large'' and large.' ) ).toBe( {"joe":1,"can't":1,"tell":1,"between":1,"large":2,"and":1} );
49
+ });
50
+
51
+ });
52
+
53
+ }
54
+
55
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "dependencies":{
3
+ "testbox":"^2.5.0+107"
4
+ },
5
+ "installPaths":{
6
+ "testbox":"testbox"
7
+ }
8
+ }
@@ -0,0 +1,37 @@
1
+ <!---
2
+
3
+ This file will only be used if you want to start up a web server in this directory. You can do so by running:
4
+
5
+ $> box
6
+ CommandBox> install
7
+ CommandBox> server start
8
+
9
+ However, this is not necessary unless you really just want to use the HTML reporters on TestBox.
10
+ Ideally, you'll skip the need for this file entirely and just run the tests directly frm the CLI like this:
11
+
12
+ CommandBox> task run TestRunner
13
+
14
+ --->
15
+ <cfsetting showDebugOutput="false">
16
+ <cfparam name="url.reporter" default="simple">
17
+ <cfscript>
18
+ // get a list of all CFCs in this folder whose name looks like "XXXTest.cfc"
19
+ // And turn it into compnent path relative to the web root
20
+ url.bundles = directoryList(
21
+ path=expandPath( '/' ),
22
+ filter='*Test.cfc' )
23
+ .map( function( path ) {
24
+ return path
25
+ .replaceNoCase( expandPath( '/' ), '' )
26
+ .left( -4 )
27
+ } )
28
+ .toList();
29
+ </cfscript>
30
+
31
+ <!--- Ensure TestBox --->
32
+ <cfif fileExists( "/testbox/system/runners/HTMLRunner.cfm" )>
33
+ <!--- Include the TestBox HTML Runner --->
34
+ <cfinclude template="/testbox/system/runners/HTMLRunner.cfm">
35
+ <cfelse>
36
+ Oops, you don't have TestBox installed yet! Please run <b>box install</b> from the root of your excercise folder and refresh this page.
37
+ </cfif>
@@ -70,7 +70,7 @@ component {
70
70
  .indentedYellowLine( exerciseDirectory & '/Solution.cfc' )
71
71
  .line()
72
72
  .greenLine( 'Test your solution with this command: ' )
73
- .indentedYellowLine( 'box task run TestRunner --solution' )
73
+ .indentedYellowLine( 'box task run TestRunner --:solution' )
74
74
  .line()
75
75
  .toConsole();
76
76
 
@@ -13,7 +13,7 @@ component {
13
13
  command( 'task run' )
14
14
  .params( 'TestRunner' )
15
15
  // Specifically as the task runners to run the SolutionTest
16
- .flags( 'solution' )
16
+ .flags( ':solution' )
17
17
  .inWorkingDirectory( path )
18
18
  .run();
19
19
  }
@@ -68,6 +68,15 @@
68
68
  "Maybe"
69
69
  ]
70
70
  },
71
+ {
72
+ "uuid": "6eba4eac-6665-4ad6-ac21-3651a11ab4b4",
73
+ "slug": "isogram",
74
+ "core": false,
75
+ "unlocked_by": null,
76
+ "difficulty": 1,
77
+ "topics": [
78
+ ]
79
+ },
71
80
  {
72
81
  "uuid": "85d77b8e-9b87-4d02-9fba-81f843bd66f1",
73
82
  "slug": "rna-transcription",
@@ -0,0 +1,73 @@
1
+ # Isogram
2
+
3
+ Determine if a word or phrase is an isogram.
4
+
5
+ An isogram (also known as a "nonpattern word") is a word or phrase without a repeating letter.
6
+
7
+ Examples of isograms:
8
+
9
+ - lumberjacks
10
+ - background
11
+ - downstream
12
+
13
+ The word *isograms*, however, is not an isogram, because the s repeats.
14
+
15
+
16
+ ## Getting Started
17
+
18
+ For installation and learning resources, refer to the
19
+ [exercism help page](http://exercism.io/languages/haskell).
20
+
21
+ ## Running the tests
22
+
23
+ To run the test suite, execute the following command:
24
+
25
+ ```bash
26
+ stack test
27
+ ```
28
+
29
+ #### If you get an error message like this...
30
+
31
+ ```
32
+ No .cabal file found in directory
33
+ ```
34
+
35
+ You are probably running an old stack version and need
36
+ to upgrade it.
37
+
38
+ #### Otherwise, if you get an error message like this...
39
+
40
+ ```
41
+ No compiler found, expected minor version match with...
42
+ Try running "stack setup" to install the correct GHC...
43
+ ```
44
+
45
+ Just do as it says and it will download and install
46
+ the correct compiler version:
47
+
48
+ ```bash
49
+ stack setup
50
+ ```
51
+
52
+ ## Running *GHCi*
53
+
54
+ If you want to play with your solution in GHCi, just run the command:
55
+
56
+ ```bash
57
+ stack ghci
58
+ ```
59
+
60
+ ## Feedback, Issues, Pull Requests
61
+
62
+ The [exercism/haskell](https://github.com/exercism/haskell) repository on
63
+ GitHub is the home for all of the Haskell exercises.
64
+
65
+ If you have feedback about an exercise, or want to help implementing a new
66
+ one, head over there and create an issue. We'll do our best to help you!
67
+
68
+ ## Source
69
+
70
+ Wikipedia [https://en.wikipedia.org/wiki/Isogram](https://en.wikipedia.org/wiki/Isogram)
71
+
72
+ ## Submitting Incomplete Solutions
73
+ It's possible to submit an incomplete solution so you can see how others have completed the exercise.
@@ -0,0 +1,16 @@
1
+ name: isogram
2
+
3
+ dependencies:
4
+ - base
5
+
6
+ library:
7
+ exposed-modules: Isogram
8
+ source-dirs: src
9
+
10
+ tests:
11
+ test:
12
+ main: Tests.hs
13
+ source-dirs: test
14
+ dependencies:
15
+ - isogram
16
+ - hspec
@@ -0,0 +1,7 @@
1
+ module Isogram (isIsogram) where
2
+
3
+ import Data.Char (toLower, isLetter)
4
+ import Data.List (sort, group)
5
+
6
+ isIsogram :: String -> Bool
7
+ isIsogram = all ((1==) . length) . group . sort . filter isLetter . map toLower
@@ -0,0 +1,20 @@
1
+ name: isogram
2
+ version: 1.1.0.1
3
+
4
+ dependencies:
5
+ - base
6
+
7
+ library:
8
+ exposed-modules: Isogram
9
+ source-dirs: src
10
+ dependencies:
11
+ # - foo # List here the packages you
12
+ # - bar # want to use in your solution.
13
+
14
+ tests:
15
+ test:
16
+ main: Tests.hs
17
+ source-dirs: test
18
+ dependencies:
19
+ - isogram
20
+ - hspec