class Crew::Docs

Public Class Methods

new(home) click to toggle source
# File lib/crew/docs.rb, line 3
def initialize(home)
  @home = home
  @path = File.join(@home.home_path, "docs.html")
end

Public Instance Methods

generate() click to toggle source
# File lib/crew/docs.rb, line 8
def generate
  template = File.read(File.expand_path("../template/docs.html.erb", __FILE__))
  File.open(@path, 'w') do |file|
    home = @home
    def render_task(task)
      task_template = File.read(File.expand_path("../template/_task.html.erb", __FILE__))
      ERB.new(task_template).result(binding)
    end
    file << ERB.new(template).result(binding)
  end
  @path
end
render_task(task) click to toggle source
# File lib/crew/docs.rb, line 12
def render_task(task)
  task_template = File.read(File.expand_path("../template/_task.html.erb", __FILE__))
  ERB.new(task_template).result(binding)
end