2011-10-08 17:34:30 +04:00
|
|
|
$:.unshift File.dirname(__FILE__) unless $:.include? '.'
|
2011-01-22 16:18:01 +03:00
|
|
|
|
|
|
|
ROOT = '.'
|
|
|
|
LIB_ROOT = File.join ROOT, 'lib'
|
|
|
|
|
|
|
|
task :default => :test
|
|
|
|
|
|
|
|
if File.directory? 'rake_tasks'
|
|
|
|
|
|
|
|
# load rake tasks from subfolder
|
|
|
|
for task_file in Dir['rake_tasks/*.rake'].sort
|
|
|
|
load task_file
|
|
|
|
end
|
|
|
|
|
|
|
|
else
|
|
|
|
|
2011-10-08 17:34:30 +04:00
|
|
|
# fallback tasks when rake_tasks folder is not present (eg. in the distribution package)
|
2011-01-22 16:18:01 +03:00
|
|
|
desc 'Run CodeRay tests (basic)'
|
|
|
|
task :test do
|
|
|
|
ruby './test/functional/suite.rb'
|
|
|
|
ruby './test/functional/for_redcloth.rb'
|
|
|
|
end
|
|
|
|
|
2011-10-08 17:34:30 +04:00
|
|
|
gem 'rdoc' if defined? gem
|
|
|
|
require 'rdoc/task'
|
2011-01-22 16:18:01 +03:00
|
|
|
desc 'Generate documentation for CodeRay'
|
|
|
|
Rake::RDocTask.new :doc do |rd|
|
|
|
|
rd.title = 'CodeRay Documentation'
|
2011-10-08 17:34:30 +04:00
|
|
|
rd.main = 'README_INDEX.rdoc'
|
2011-01-22 16:18:01 +03:00
|
|
|
rd.rdoc_files.add Dir['lib']
|
2011-10-08 17:34:30 +04:00
|
|
|
rd.rdoc_files.add rd.main
|
2011-01-22 16:18:01 +03:00
|
|
|
rd.rdoc_dir = 'doc'
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|