def generate_html
      FileUtils.rm_rf(Rails.root.join('tmp/apidocs'))
      options = [Rails.root.join("app/controllers").to_s, "--op=#{Rails.root.join('tmp/apidocs')}"]

      self.store = RDoc::Store.new

      @options = load_options
      @options.parse options
      @exclude = @options.exclude

      @last_modified = setup_output_dir @options.op_dir, @options.force_update

      @store.encoding = @options.encoding if @options.respond_to? :encoding
      @store.dry_run = @options.dry_run
      @store.main = @options.main_page
      @store.title = @options.title
      @store.path = @options.op_dir

      @start_time = Time.now
      @store.load_cache
      @options.default_title = "RDoc Documentation"

      parse_files @options.files
      @store.complete @options.visibility

      formatter = RDoc::Markup::ToHtml.new(RDoc::Options.new)

      routes = routes_by_regex.map do |r|
        {verb: r[:verb],
         path: r[:path].sub('(.:format)', ''),
         class_name: gen_class_name(r),
         action_name: gen_action_name(r)
        }
      end.each do |r|
        doc = document_route(r)
        r[:html_comment] = doc ? doc.accept(formatter) : ""
      end.select { |r| r[:class_name] != "ApidocsController" }

      puts routes.inspect
      routes
    end
def generate_html
      FileUtils.rm_rf(Rails.root.join('tmp/apidocs'))
      options = [Rails.root.join("app/controllers").to_s, "--op=#{Rails.root.join('tmp/apidocs')}"]

      self.store = RDoc::Store.new

      @options = load_options
      @options.parse options
      @exclude = @options.exclude

      @last_modified = setup_output_dir @options.op_dir, @options.force_update

      @store.encoding = @options.encoding if @options.respond_to? :encoding
      @store.dry_run = @options.dry_run
      @store.main = @options.main_page
      @store.title = @options.title
      @store.path = @options.op_dir

      @start_time = Time.now
      @store.load_cache
      @options.default_title = "RDoc Documentation"

      parse_files @options.files
      @store.complete @options.visibility

      formatter = RDoc::Markup::ToHtml.new(RDoc::Options.new)

      routes = routes_by_regex.map do |r|
        {verb: r[:verb],
         path: r[:path].sub('(.:format)', ''),
         class_name: gen_class_name(r),
         action_name: gen_action_name(r)
        }
      end.each do |r|
        doc = document_route(r)
        r[:html_comment] = doc ? doc.accept(formatter) : ""
      end.select { |r| r[:class_name] != "ApidocsController" }

      puts routes.inspect
      routes
    end
generate_html entry point for on fly document generation