-
Notifications
You must be signed in to change notification settings - Fork 3
/
Rakefile
76 lines (61 loc) · 1.73 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
def dump_load_path
puts $LOAD_PATH.join("\n")
found = nil
$LOAD_PATH.each do |path|
if File.exists?(File.join(path,"rspec"))
puts "Found rspec in #{path}"
if File.exists?(File.join(path,"rspec","core"))
puts "Found core"
if File.exists?(File.join(path,"rspec","core","rake_task"))
puts "Found rake_task"
found = path
else
puts "!! no rake_task"
end
else
puts "!!! no core"
end
end
end
if found.nil?
puts "Didn't find rspec/core/rake_task anywhere"
else
puts "Found in #{path}"
end
end
require 'bundler'
require 'rake/clean'
require 'rake/testtask'
gem 'rdoc' # we need the installed RDoc gem, not the system one
require 'rdoc/task'
include Rake::DSL
Bundler::GemHelper.install_tasks
task :test => :build
task :release => :test
task :install => :build
task :build => :tangle
task :build => :weave
task :weave => :tangle
lmd_files = Rake::FileList['src/**/*.lmd']
outputs = lmd_files.pathmap('%{^src,lib}X')
docs = lmd_files.pathmap('%{^src,doc}X.md')
task :tangle => outputs
task :weave => docs
lmd_files.zip(outputs, docs).each do |lmd_file, output, doc|
directory output_dir = output.pathmap('%d')
directory doc_dir = doc.pathmap('%d')
file output => [output_dir, lmd_file] do #FIXME LMT steps need to be aware of includes
sh "ruby bin/lmt --file #{lmd_file} --output #{output} --dev"
end
file doc => ["lib/lmt/lmw.rb", doc_dir, lmd_file] do
sh "ruby bin/lmw --file #{lmd_file} --output #{doc}"
end
end
Rake::TestTask.new do |t|
t.pattern = 'test/tc_*.rb'
end
Rake::RDocTask.new do |rd|
rd.main = "README.rdoc"
rd.rdoc_files.include("README.rdoc","lib/**/*.rb","bin/**/*")
end
task :default => [:test]