-
Notifications
You must be signed in to change notification settings - Fork 17
/
Rakefile
46 lines (41 loc) · 1.44 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
require 'rake'
require 'lib/pdoc'
desc "Builds the documentation"
task :build_doc do
PDoc.run({
:source_files => [File.join(File.dirname(__FILE__), "test", "fixtures", "ajax.js")],
:destination => OUTPUT_DIR,
:syntax_highlighter => :pygments,
:markdown_parser => :bluecloth,
:src_code_href => proc { |file, line|
"http://github.com/example/ex/#{file}##{line}"
},
:pretty_urls => false,
:bust_cache => true,
:name => 'Example JavaScript Framework',
:short_name => 'Ex',
:home_url => 'http://example.com',
:doc_url => 'http://example.com/api',
:version => "1.2.0",
:copyright_notice => 'This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-Share Alike 3.0 Unported License</a>.'
})
end
desc "Empties output directory"
task :remove_doc do
rm_rf Dir.glob(File.join(OUTPUT_DIR, "*"))
end
desc "Empties the output directory and builds the documentation."
task :doc => [:remove_doc, :build_doc]
desc "Runs all the unit tests."
task :test do
require 'rake/runtest'
Rake.run_tests '**/*_test.rb'
end
task :compile_parser do
require 'treetop'
compiler = Treetop::Compiler::GrammarCompiler.new
treetop_dir = File.expand_path(File.join(File.dirname(__FILE__), "lib", "pdoc", "parser", "treetop_files"))
Dir.glob(File.join(treetop_dir, "*.treetop")).each do |treetop_file_path|
compiler.compile(treetop_file_path)
end
end