public
Description: Ruby library for the Auto-lead Data Format
Homepage:
Clone URL: git://github.com/remi/adf.git
adf / Rakefile
100644 47 lines (41 sloc) 1.353 kb
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
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
 
desc "Quickly [re]generate and view docs"
task :docs do |t|
  puts 'generating documentation ...'
  system("rake --silent doc:recreate TEMPLATE=allison")
  puts 'opening firefox ...'
  system("firefox doc/index.html &")
  puts 'done.'
end
 
desc 'run unit tests and specs'
task :test => :spec do
  # ...
end
 
desc 'run specs'
task :spec do
  exec 'spec spec/*'
end
 
namespace :doc do
  desc "Generate documentation for the application. Set custom template with TEMPLATE=/path/to/rdoc/template.rb"
  Rake::RDocTask.new("create") do |rdoc|
    rdoc.rdoc_dir = 'doc'
    rdoc.main = 'README'
    rdoc.title = "Andale Advertising - Drivers Club Web Application"
    rdoc.options << '--line-numbers' << '--inline-source'
    rdoc.options << '--charset' << 'utf-8'
    rdoc.rdoc_files.include('README','COPYING.rdoc')
    rdoc.rdoc_files.include('app/**/*.rb')
    rdoc.rdoc_files.include('lib/**/*.rb')
 
    # rake doc:create TEMPLATE=allison for a shortcut to using the allison template
    if ENV['TEMPLATE']
      if ENV['TEMPLATE'] == 'allison'
        allison = `gem which allison | grep -v "Can't find " | grep -v "(checking gem"`.strip.sub(/\.rb$/,'')
        rdoc.template = allison unless allison.empty?
      else
        rdoc.template = ENV['TEMPLATE']
      end
    end
  end
end