WebRI  WebRI::Blackfish

[Validate]
Generated with WebRI Redfish 1.2

Blackfish

Blackfish is based on Vladimir Kolesnikov’s SDoc (Copyright © 2009 Vladimir Kolesnikov).

The SDoc code base was helpful in understanding how to build an RDoc generator. It was convenient to keep a copy in with the WebRI code for reference. Later, it was easy enough to integrate it with the rest of WebRI (eg. splitting Search into a separate component), and so it has stayed as an alernate template with a few style modifications.

Public Instance Methods

each_letter_group(methods, &block) click to toggle source

TODO: Does this belong here or in the quicksearch component?

# File lib/webri/generators/blackfish/generator.rb, line 34
    def each_letter_group(methods, &block)
      group = {:name => '', :methods => []}
      methods.sort{ |a, b| a.name <=> b.name }.each do |method|
        gname = group_name method.name
        if gname != group[:name]
          yield group unless group[:methods].size == 0
          group = {
            :name => gname,
            :methods => []
          }
        end
        group[:methods].push(method)
      end
      yield group unless group[:methods].size == 0
    end

Protected Instance Methods

group_name(name) click to toggle source
# File lib/webri/generators/blackfish/generator.rb, line 54
    def group_name(name)
      if match = name.match(/^([a-z])/i)
        match[1].upcase
      else
        '#'
      end
    end

Disabled; run with --debug to generate this.