Module: Docter::Rake

Defined in:
lib/docter/rake.rb

Class Method Summary collapse

Class Method Details

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



6
7
8
9
10
11
12
# File 'lib/docter/rake.rb', line 6

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



14
15
16
17
18
19
20
# File 'lib/docter/rake.rb', line 14

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