This repository has been archived by the owner on Jan 6, 2023. It is now read-only.
forked from mislav/hanna
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Erik Hollensbe
committed
Jul 8, 2010
1 parent
258c1f9
commit 5950155
Showing
2 changed files
with
41 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,37 +1,51 @@ | |||
- methods = methods_from_sections values[:sections] | - methods = values[:entry].method_list + values[:entry].attributes | ||
- unless methods.empty? | - unless methods.empty? | ||
#method-list | #method-list | ||
%h2 Methods | %h2 Methods | ||
- for type in ['public class', 'protected class', 'public instance', 'protected instance'] | - types = %w[attr_reader attr_writer attr_accessor class instance] | ||
- unless (list = methods[type]).empty? | - visibilities = [:public, :protected, :private] | ||
%h3= type | - types.each do |type| | ||
%ol | - visibilities.each do |vis| | ||
- for method in list | - list = methods.select { |x| x.visibility == vis && x.type == type } | ||
- if method[:name].to_s.empty? && method[:callseq] | - unless list.empty? | ||
%li= link_to method[:callseq].gsub(/<br\s*\/?>/, "").split(/[\r\n]+/).map{ |s| s.split(/([({]+|\[\{|\s+(#?=>|→)\s+)/).first.sub(/^[A-Za-z0-9_:]+\./, "").sub(/\s+=\s+.*/, "=").strip }.uniq.join("<br />\n"), '#' + method[:aref] | - type_result = "" | ||
- else | - if type =~ /^attr_/ | ||
%li= link_to method[:name], '#' + method[:aref] | - type_result += type.sub(/^attr_/, '').capitalize | ||
- else | |||
- type_result += type.capitalize | |||
- type_result = "#{vis.to_s.capitalize} #{type_result}" | |||
%h3= type_result | |||
%ol | |||
- list.each do |method| | |||
- if method.respond_to?(:aref) | |||
- if method.name.to_s.empty? && method.call_seq | |||
%li= link_to method.call_seq.gsub(/<br\s*\/?>/, "").split(/[\r\n]+/).map{ |s| s.split(/([({]+|\[\{|\s+(#?=>|→)\s+)/).first.sub(/^[A-Za-z0-9_:]+\./, "").sub(/\s+=\s+.*/, "=").strip }.uniq.join("<br />\n"), '#' + method.aref | |||
- else | |||
%li= link_to method.name, '#' + method.aref | |||
- else | |||
%li= method.name | |||
|
|
||
- if values[:requires] or values[:toc] or values[:includes] | - if values[:entry].requires or values[:entry].sections or values[:entry].includes | ||
#context | #context | ||
- if values[:requires] | - if values[:entry].requires | ||
#requires | #requires | ||
%h2 Required files | %h2 Required files | ||
%ol | %ol | ||
- for req in values[:requires] | - values[:entry].requires do |req| | ||
%li= link_to req[:name], req[:aref] | %li= link_to req, req | ||
|
|
||
- if values[:toc] | -# FIXME reenable | ||
#contents | -#- if values[:entry].sections | ||
%h2 Contents | -##contents | ||
%ol | -#%h2 Contents | ||
- for item in values[:toc] | -#%ol | ||
%li= link_to values[:secname], values[:href] | -#- values[:entry].sections.each do |item| | ||
-#%li= link_to values[:secname], values[:href] | |||
- if values[:includes] | - if values[:entry].includes | ||
#includes | #includes | ||
%h2 Included modules | %h2 Included modules | ||
%ol | %ol | ||
- for inc in values[:includes] | - values[:entry].includes do |inc| | ||
%li= link_to inc[:name], inc[:aref] | %li= link_to inc, inc | ||
|
|