Flowdock
method

generate_guide

Importance_0
v3.0.0 - Show latest stable - 0 notes - Class: RailsGuides::Generator
generate_guide(guide, output_file) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File railties/guides/rails_guides/generator.rb, line 126
    def generate_guide(guide, output_file)
      puts "Generating #{output_file}"
      File.open(File.join(output_dir, output_file), 'w') do |f|
        view = ActionView::Base.new(source_dir, :edge => edge)
        view.extend(Helpers)

        if guide =~ /\.html\.erb$/
          # Generate the special pages like the home.
          result = view.render(:layout => 'layout', :file => guide)
        else
          body = File.read(File.join(source_dir, guide))
          body = set_header_section(body, view)
          body = set_index(body, view)

          result = view.render(:layout => 'layout', :text => textile(body))

          warn_about_broken_links(result) if @warnings
        end

        f.write result
      end
    end
Register or log in to add new notes.