Class: Crew::Docs
- Inherits:
-
Object
- Object
- Crew::Docs
- Defined in:
- lib/crew/docs.rb
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(home) ⇒ Docs
constructor
A new instance of Docs.
Constructor Details
#initialize(home) ⇒ Docs
Returns a new instance of Docs.
3 4 5 6 |
# File 'lib/crew/docs.rb', line 3 def initialize(home) @home = home @path = File.join(@home.home_path, "docs.html") end |
Instance Method Details
#generate ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/crew/docs.rb', line 8 def generate template = File.read(File.("../template/docs.html.erb", __FILE__)) File.open(@path, 'w') do |file| home = @home def render_task(task) task_template = File.read(File.("../template/_task.html.erb", __FILE__)) ERB.new(task_template).result(binding) end file << ERB.new(template).result(binding) end @path end |