Module: Docter::Rake

Defined in:
lib/docter/rake.rb

Class Method Summary collapse

Class Method Details

.generate(target, collection, template, *args) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/docter/rake.rb', line 22

def generate(target, collection, template, *args)
  options = Hash === args.last ? args.pop.clone : {}
  args.each { |arg| options[arg.to_sym] = true }
  file target=>collection.dependencies + template.dependencies do |task|
    collection.generate template, task.name, options[:one_page] ? :one_page : :all, options
  end
end

.serve(task_name, collection, template, *args) ⇒ Object



30
31
32
33
34
35
36
# File 'lib/docter/rake.rb', line 30

def serve(task_name, collection, template, *args)
  options = Hash === args.last ? args.pop.clone : {}
  args.each { |arg| options[arg.to_sym] = true }
  task task_name do
    collection.serve template, options
  end
end