trackler 2.2.1.114 → 2.2.1.115

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fde316d3b2d472723936a34bb19bfc1ffac92dd6
4
- data.tar.gz: 7973373abc695c32ac3b302801a72c0b321f2bb3
3
+ metadata.gz: a973bc08e042be7c0a98c8daa57f0f81d5ff009c
4
+ data.tar.gz: f0ed6e91cf8aec9a4b45324e38f482cbf46e3c03
5
5
  SHA512:
6
- metadata.gz: 852b587d1f3b0c7e6739cd567d2231a0ad0ddf65029d1ce8aa82cb074fb29065da97ee147cff3e9a88478755d9d3740533450b7fb4b00581af85accdd760c134
7
- data.tar.gz: 91ca6592cef60372180555ba159e66d4b324a65c9c02a37e8f0bad69bfb3636cdd3a3baf0756a9cb4dae898a790bbcb2da6b736d8ece08605650ca16f3e3fe93
6
+ metadata.gz: 52b97d29dcfe66c8569302a2a89532164f00c37353749cb3181e6a99f88430fffae43afaf825f2e4a7399a2a437af37d1dd4e66046031bed5490e83a6a35a3b2
7
+ data.tar.gz: ebbb7a299f91d23a101d0a7b9a6794fac451addfc67a2e983916b5e54b641372aa5426290e6b4f92dbc9077cd62b2a39aae0b1f089650d25711d192cd3cb4b4c
@@ -1,3 +1,3 @@
1
1
  module Trackler
2
- VERSION = "2.2.1.114"
2
+ VERSION = "2.2.1.115"
3
3
  end
@@ -33,7 +33,7 @@
33
33
  "uuid": "8bdf3796-592c-48f1-b2ef-8e4deb40cc37"
34
34
  },
35
35
  {
36
- "core": false,
36
+ "core": true,
37
37
  "difficulty": 1,
38
38
  "slug": "bob",
39
39
  "topics": [
@@ -23,18 +23,19 @@ modules:
23
23
  - use: Data::Dump
24
24
  - use: Foo::Bar
25
25
  methods: 'foo bar'
26
- tests: |
26
+ tests: |-
27
27
  ok my-subroutine, 'Perl 6 code here';
28
28
  pass;
29
29
 
30
30
  unit: module
31
- example: |
32
- sub my-subroutine is export {
33
- True;
34
- }
35
-
36
- class MyClass is export {
37
- }
31
+ examples:
32
+ base: |-
33
+ sub my-subroutine is export {
34
+ True;
35
+ }
36
+
37
+ class MyClass is export {
38
+ }
38
39
  ```
39
40
 
40
41
  You must have `Template::Mustache` and `YAML::Parser::LibYAML` to run `exercise-gen.pl6`.
@@ -62,14 +62,24 @@ sub generate ($exercise) {
62
62
  print "Generating $exercise... ";
63
63
 
64
64
  given Exercism::Generator.new: :$exercise, data => yaml-parse $yaml-file.absolute {
65
- given $exercise-dir.add("$exercise.t") -> $testfile {
66
- $testfile.spurt: .test;
67
- $testfile.chmod: 0o755;
68
- try nqp::symlink("../../$_", ~$exercise-dir.add(".meta/solutions/$_")) given $testfile.basename;
69
- }
65
+ my $testfile = $exercise-dir.add("$exercise.t");
66
+ $testfile.spurt: .test;
67
+ $testfile.chmod: 0o755;
68
+
70
69
  $exercise-dir.add("{.data<exercise>}.pm6").spurt: .stub;
70
+
71
71
  $exercise-dir.add('.meta/solutions').mkdir;
72
- $exercise-dir.add(".meta/solutions/{.data<exercise>}.pm6").spurt: .example;
72
+ for .examples.pairs -> $example {
73
+ if $example.key ~~ 'base' {
74
+ $exercise-dir.add(".meta/solutions/{.data<exercise>}.pm6").spurt: $example.value;
75
+ try nqp::symlink("../../$_", ~$exercise-dir.add(".meta/solutions/$_")) given $testfile.basename;
76
+ }
77
+ else {
78
+ $exercise-dir.add(".meta/solutions/{$example.key}").mkdir;
79
+ $exercise-dir.add(".meta/solutions/{$example.key}/{.data<exercise>}.pm6").spurt: $example.value;
80
+ try nqp::symlink("../../../$_", ~$exercise-dir.add(".meta/solutions/{$example.key}/$_")) given $testfile.basename;
81
+ }
82
+ }
73
83
  }
74
84
 
75
85
  given $base-dir.add('bin/configlet') {
@@ -4,7 +4,7 @@
4
4
  "active": true,
5
5
  "blurb": "Forget everything you know or think you know about Perl. Perl 6 is a production ready new emerging language that is highly expressive, feature-packed and optimized for fun.",
6
6
  "test_pattern": ".*\\.t$",
7
- "solution_pattern": "\\.meta/solutions/[^/]+\\.pm6$",
7
+ "solution_pattern": "\\.meta/solutions/.+\\.pm6$",
8
8
  "foregone": [
9
9
 
10
10
  ],
@@ -14,24 +14,26 @@ submethod TWEAK {
14
14
  }
15
15
  }
16
16
 
17
- method cdata {
17
+ method cdata (--> Str:D) {
18
18
  %!data<cdata><json> ?? %!data<cdata><json> !! '';
19
19
  }
20
20
 
21
- method test {
22
- self!render(template => 'test');
21
+ method test (--> Str:D) {
22
+ self!render;
23
23
  }
24
24
 
25
- method stub {
26
- self!render(template => 'module', file => 'stub');
25
+ method stub (--> Str:D) {
26
+ self!render: %!data<stub> || '';
27
27
  }
28
28
 
29
- method example {
30
- self!render(template => 'module', file => 'example');
29
+ method examples (--> Hash()) {
30
+ return %!data<examples>
31
+ ?? %!data<examples>.map: {.key => self!render: .value}
32
+ !! base => self!render: %!data<example>;
31
33
  }
32
34
 
33
- method !render (:$template!, :$file) {
34
- my $data = %!data;
35
- if $file { $data<module_file> = $data{$file} };
36
- Template::Mustache.render($base-dir.add("templates/$template.mustache").slurp, $data);
35
+ method !render (Str $module_file? --> Str:D) {
36
+ Template::Mustache.render(
37
+ $base-dir.add("templates/{$module_file.defined ?? 'module' !! 'test'}.mustache").slurp, %(|%!data, :$module_file)
38
+ );
37
39
  }
@@ -238,7 +238,6 @@
238
238
  "integers",
239
239
  "mathematics"
240
240
  ],
241
- "unlocked_by": "bob",
242
241
  "uuid": "4ecf9470-a959-11e7-abc4-cec278b6b50a"
243
242
  },
244
243
  {
@@ -253,7 +252,6 @@
253
252
  "matrices",
254
253
  "text_formatting"
255
254
  ],
256
- "unlocked_by": "prime-factors",
257
255
  "uuid": "167ec8f2-a206-4a7e-999d-7dbfc136a9fe"
258
256
  },
259
257
  {
@@ -367,7 +365,7 @@
367
365
  "control_flow_loops",
368
366
  "recursion"
369
367
  ],
370
- "unlocked_by": "sum-of-multiples",
368
+ "unlocked_by": "binary-search",
371
369
  "uuid": "b912fe4f-c505-4bac-8029-76412644375b"
372
370
  },
373
371
  {
@@ -652,7 +650,7 @@
652
650
  "uuid": "10edb37d-cf5d-443a-bb4c-8831a3986b61"
653
651
  },
654
652
  {
655
- "core": false,
653
+ "core": true,
656
654
  "difficulty": 5,
657
655
  "slug": "rational-numbers",
658
656
  "topics": [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trackler
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1.114
4
+ version: 2.2.1.115
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katrina Owen