Class: Chapter11_1::Generators::BeginGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Chapter11_1::Generators::BeginGenerator
- Defined in:
- lib/generators/chapter11_1/begin/begin_generator.rb
Instance Method Summary collapse
Instance Method Details
#copy_app_tree ⇒ Object
6 7 8 |
# File 'lib/generators/chapter11_1/begin/begin_generator.rb', line 6 def copy_app_tree directory(self.class.source_root, Rails.root) end |
#generate_instructions ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/generators/chapter11_1/begin/begin_generator.rb', line 10 def generate_instructions require 'rdiscount' instr_md = File.('../instructions.md',self.class.source_root) return unless File.exists?(instr_md) dest = File.join(Rails.root,'doc','chapter11_1.html') copy_file(instr_md, dest, :force => true) do |content| RDiscount.new(content).to_html end say_status('Note',"Now open file://#{dest} in your web browser for instructions", :cyan) end |