Skip to content

Commit 9c4dda8

Browse files
author
Dean Hudson
committed
Make jskoans use same rake build and run pattern as ruby koans
1 parent 2a52a95 commit 9c4dda8

21 files changed

+76
-42
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
*.swp
2-
.idea
2+
.ideatopics
3+
koans/

Rakefile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env ruby
2+
# -*- ruby -*-
3+
4+
require 'rake/clean'
5+
6+
SRC_DIR = 'src'
7+
PROB_DIR = 'koans'
8+
9+
SRC_FILES = FileList["#{SRC_DIR}/*"]
10+
KOAN_FILES = SRC_FILES.pathmap("#{PROB_DIR}/%f")
11+
12+
task :default => :walk_the_path
13+
14+
task :walk_the_path do
15+
`open koans/jskoans.htm`
16+
end
17+
18+
directory PROB_DIR
19+
20+
desc "Generate the Koans from the source files from scratch."
21+
task :regen => [:clobber_koans, :gen]
22+
23+
desc "Generate the Koans from the changed source files."
24+
task :gen => KOAN_FILES + [PROB_DIR]
25+
task :clobber_koans do
26+
rm_r PROB_DIR
27+
end
28+
29+
SRC_FILES.each do |koan_src|
30+
file koan_src.pathmap("#{PROB_DIR}/%f") => [PROB_DIR, koan_src] do |t|
31+
cp koan_src, t.name
32+
end
33+
end

jskoans.htm

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)