rdoc 2.5.11 → 3.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of rdoc might be problematic. Click here for more details.

Files changed (113) hide show
  1. data.tar.gz.sig +0 -0
  2. data/.document +1 -0
  3. data/History.txt +95 -0
  4. data/Manifest.txt +13 -4
  5. data/README.txt +9 -3
  6. data/Rakefile +1 -1
  7. data/lib/rdoc.rb +15 -298
  8. data/lib/rdoc/alias.rb +65 -16
  9. data/lib/rdoc/any_method.rb +27 -150
  10. data/lib/rdoc/attr.rb +36 -115
  11. data/lib/rdoc/class_module.rb +236 -22
  12. data/lib/rdoc/code_object.rb +76 -31
  13. data/lib/rdoc/constant.rb +32 -4
  14. data/lib/rdoc/context.rb +494 -222
  15. data/lib/rdoc/encoding.rb +79 -0
  16. data/lib/rdoc/erbio.rb +37 -0
  17. data/lib/rdoc/gauntlet.rb +9 -5
  18. data/lib/rdoc/generator.rb +33 -1
  19. data/lib/rdoc/generator/darkfish.rb +284 -375
  20. data/lib/rdoc/generator/markup.rb +72 -36
  21. data/lib/rdoc/generator/ri.rb +4 -4
  22. data/lib/rdoc/generator/template/darkfish/classpage.rhtml +267 -274
  23. data/lib/rdoc/generator/template/darkfish/filepage.rhtml +91 -91
  24. data/lib/rdoc/generator/template/darkfish/index.rhtml +45 -45
  25. data/lib/rdoc/generator/template/darkfish/rdoc.css +298 -298
  26. data/lib/rdoc/include.rb +40 -1
  27. data/lib/rdoc/known_classes.rb +1 -0
  28. data/lib/rdoc/markup.rb +467 -2
  29. data/lib/rdoc/markup/attribute_manager.rb +24 -6
  30. data/lib/rdoc/markup/blank_line.rb +11 -3
  31. data/lib/rdoc/markup/document.rb +6 -0
  32. data/lib/rdoc/markup/formatter.rb +10 -0
  33. data/lib/rdoc/markup/formatter_test_case.rb +339 -3
  34. data/lib/rdoc/markup/heading.rb +3 -0
  35. data/lib/rdoc/markup/inline.rb +11 -1
  36. data/lib/rdoc/markup/list.rb +3 -0
  37. data/lib/rdoc/markup/list_item.rb +3 -0
  38. data/lib/rdoc/markup/paragraph.rb +3 -0
  39. data/lib/rdoc/markup/parser.rb +191 -237
  40. data/lib/rdoc/markup/{preprocess.rb → pre_process.rb} +50 -29
  41. data/lib/rdoc/markup/raw.rb +4 -0
  42. data/lib/rdoc/markup/rule.rb +3 -0
  43. data/lib/rdoc/markup/text_formatter_test_case.rb +116 -0
  44. data/lib/rdoc/markup/to_ansi.rb +14 -2
  45. data/lib/rdoc/markup/to_bs.rb +8 -2
  46. data/lib/rdoc/markup/to_html.rb +84 -91
  47. data/lib/rdoc/markup/to_html_crossref.rb +77 -26
  48. data/lib/rdoc/markup/to_rdoc.rb +94 -49
  49. data/lib/rdoc/markup/to_test.rb +9 -1
  50. data/lib/rdoc/markup/verbatim.rb +6 -3
  51. data/lib/rdoc/method_attr.rb +353 -0
  52. data/lib/rdoc/normal_class.rb +11 -2
  53. data/lib/rdoc/normal_module.rb +0 -5
  54. data/lib/rdoc/options.rb +373 -82
  55. data/lib/rdoc/parser.rb +59 -23
  56. data/lib/rdoc/parser/c.rb +224 -86
  57. data/lib/rdoc/parser/ruby.rb +219 -111
  58. data/lib/rdoc/parser/ruby_tools.rb +4 -1
  59. data/lib/rdoc/parser/simple.rb +9 -4
  60. data/lib/rdoc/rdoc.rb +68 -28
  61. data/lib/rdoc/require.rb +21 -0
  62. data/lib/rdoc/ri/driver.rb +20 -10
  63. data/lib/rdoc/ri/paths.rb +2 -2
  64. data/lib/rdoc/ri/store.rb +22 -5
  65. data/lib/rdoc/ruby_lex.rb +11 -12
  66. data/lib/rdoc/ruby_token.rb +2 -2
  67. data/lib/rdoc/single_class.rb +2 -1
  68. data/lib/rdoc/stats.rb +202 -162
  69. data/lib/rdoc/stats/normal.rb +51 -0
  70. data/lib/rdoc/stats/quiet.rb +59 -0
  71. data/lib/rdoc/stats/verbose.rb +45 -0
  72. data/lib/rdoc/text.rb +133 -4
  73. data/lib/rdoc/{tokenstream.rb → token_stream.rb} +0 -2
  74. data/lib/rdoc/top_level.rb +230 -39
  75. data/test/test_attribute_manager.rb +58 -7
  76. data/test/test_rdoc_alias.rb +13 -0
  77. data/test/test_rdoc_any_method.rb +43 -2
  78. data/test/test_rdoc_attr.rb +15 -8
  79. data/test/test_rdoc_class_module.rb +133 -0
  80. data/test/test_rdoc_code_object.rb +62 -5
  81. data/test/test_rdoc_context.rb +72 -26
  82. data/test/test_rdoc_encoding.rb +145 -0
  83. data/test/test_rdoc_generator_darkfish.rb +119 -0
  84. data/test/test_rdoc_generator_ri.rb +22 -2
  85. data/test/test_rdoc_include.rb +79 -0
  86. data/test/test_rdoc_markup_attribute_manager.rb +4 -4
  87. data/test/test_rdoc_markup_parser.rb +134 -95
  88. data/test/test_rdoc_markup_pre_process.rb +7 -2
  89. data/test/test_rdoc_markup_to_ansi.rb +43 -153
  90. data/test/test_rdoc_markup_to_bs.rb +42 -156
  91. data/test/test_rdoc_markup_to_html.rb +130 -58
  92. data/test/test_rdoc_markup_to_html_crossref.rb +10 -10
  93. data/test/test_rdoc_markup_to_rdoc.rb +40 -151
  94. data/test/test_rdoc_method_attr.rb +122 -0
  95. data/test/test_rdoc_normal_class.rb +1 -1
  96. data/test/test_rdoc_normal_module.rb +6 -1
  97. data/test/test_rdoc_options.rb +237 -12
  98. data/test/test_rdoc_parser.rb +3 -22
  99. data/test/test_rdoc_parser_c.rb +203 -2
  100. data/test/test_rdoc_parser_ruby.rb +403 -89
  101. data/test/test_rdoc_parser_simple.rb +25 -1
  102. data/test/test_rdoc_rdoc.rb +44 -32
  103. data/test/test_rdoc_ri_driver.rb +29 -24
  104. data/test/test_rdoc_ri_store.rb +46 -3
  105. data/test/test_rdoc_task.rb +1 -1
  106. data/test/test_rdoc_text.rb +102 -8
  107. data/test/test_rdoc_top_level.rb +13 -4
  108. data/test/xref_data.rb +8 -0
  109. data/test/xref_test_case.rb +6 -0
  110. metadata +29 -19
  111. metadata.gz.sig +0 -0
  112. data/lib/rdoc/parser/perl.rb +0 -165
  113. data/test/test_rdoc_parser_perl.rb +0 -73
@@ -36,8 +36,9 @@ module RDoc::Generator::Markup
36
36
  return @formatter if defined? @formatter
37
37
 
38
38
  show_hash = RDoc::RDoc.current.options.show_hash
39
+ hyperlink_all = RDoc::RDoc.current.options.hyperlink_all
39
40
  this = RDoc::Context === self ? self : @parent
40
- @formatter = RDoc::Markup::ToHtmlCrossref.new this.path, this, show_hash
41
+ @formatter = RDoc::Markup::ToHtmlCrossref.new this.path, this, show_hash, hyperlink_all
41
42
  end
42
43
 
43
44
  ##
@@ -57,36 +58,65 @@ end
57
58
 
58
59
  class RDoc::AnyMethod
59
60
 
61
+ ##
62
+ # Maps RDoc::RubyToken classes to CSS class names
63
+
64
+ STYLE_MAP = {
65
+ RDoc::RubyToken::TkCONSTANT => 'ruby-constant',
66
+ RDoc::RubyToken::TkKW => 'ruby-keyword',
67
+ RDoc::RubyToken::TkIVAR => 'ruby-ivar',
68
+ RDoc::RubyToken::TkOp => 'ruby-operator',
69
+ RDoc::RubyToken::TkId => 'ruby-identifier',
70
+ RDoc::RubyToken::TkNode => 'ruby-node',
71
+ RDoc::RubyToken::TkCOMMENT => 'ruby-comment',
72
+ RDoc::RubyToken::TkREGEXP => 'ruby-regexp',
73
+ RDoc::RubyToken::TkSTRING => 'ruby-string',
74
+ RDoc::RubyToken::TkVal => 'ruby-value',
75
+ }
76
+
60
77
  include RDoc::Generator::Markup
61
78
 
79
+ @add_line_numbers = false
80
+
81
+ class << self
82
+ ##
83
+ # Allows controlling whether <tt>#markup_code</tt> adds line numbers to
84
+ # the source code.
85
+
86
+ attr_accessor :add_line_numbers
87
+ end
88
+
62
89
  ##
63
90
  # Prepend +src+ with line numbers. Relies on the first line of a source
64
91
  # code listing having:
65
92
  #
66
- # # File xxxxx, line dddd
93
+ # # File xxxxx, line dddd
94
+ #
95
+ # If it has, line numbers are added an ', line dddd' is removed.
67
96
 
68
97
  def add_line_numbers(src)
69
- if src =~ /\A.*, line (\d+)/ then
70
- first = $1.to_i - 1
71
- last = first + src.count("\n")
72
- size = last.to_s.length
73
-
74
- line = first
75
- src.gsub!(/^/) do
76
- res = if line == first then
77
- " " * (size + 2)
78
- else
79
- "%2$*1$d: " % [size, line]
80
- end
81
-
82
- line += 1
83
- res
84
- end
98
+ return unless src.sub!(/\A(.*)(, line (\d+))/, '\1')
99
+ first = $3.to_i - 1
100
+ last = first + src.count("\n")
101
+ size = last.to_s.length
102
+
103
+ line = first
104
+ src.gsub!(/^/) do
105
+ res = if line == first then
106
+ " " * (size + 1)
107
+ else
108
+ "<span class=\"line-num\">%2$*1$d</span> " % [size, line]
109
+ end
110
+
111
+ line += 1
112
+ res
85
113
  end
86
114
  end
87
115
 
88
116
  ##
89
- # Turns the method's token stream into HTML
117
+ # Turns the method's token stream into HTML.
118
+ #
119
+ # Prepends line numbers if +add_line_numbers+ is true.
90
120
 
91
121
  def markup_code
92
122
  return '' unless @token_stream
@@ -95,32 +125,32 @@ class RDoc::AnyMethod
95
125
 
96
126
  @token_stream.each do |t|
97
127
  next unless t
98
- # style = STYLE_MAP[t.class]
99
- style = case t
100
- when RDoc::RubyToken::TkCONSTANT then "ruby-constant"
101
- when RDoc::RubyToken::TkKW then "ruby-keyword kw"
102
- when RDoc::RubyToken::TkIVAR then "ruby-ivar"
103
- when RDoc::RubyToken::TkOp then "ruby-operator"
104
- when RDoc::RubyToken::TkId then "ruby-identifier"
105
- when RDoc::RubyToken::TkNode then "ruby-node"
106
- when RDoc::RubyToken::TkCOMMENT then "ruby-comment cmt"
107
- when RDoc::RubyToken::TkREGEXP then "ruby-regexp re"
108
- when RDoc::RubyToken::TkSTRING then "ruby-value str"
109
- when RDoc::RubyToken::TkVal then "ruby-value"
110
- else
111
- nil
112
- end
128
+
129
+ style = STYLE_MAP[t.class]
113
130
 
114
131
  text = CGI.escapeHTML t.text
115
132
 
116
- if style
133
+ if style then
117
134
  src << "<span class=\"#{style}\">#{text}</span>"
118
135
  else
119
136
  src << text
120
137
  end
121
138
  end
122
139
 
123
- add_line_numbers src
140
+ # dedent the source
141
+ indent = src.length
142
+ lines = src.lines.to_a
143
+ lines.shift if src =~ /\A.*#\ *File/i # remove '# File' comment
144
+ lines.each do |line|
145
+ if line =~ /^ *(?=\S)/
146
+ n = $&.length
147
+ indent = n if n < indent
148
+ break if n == 0
149
+ end
150
+ end
151
+ src.gsub!(/^#{' ' * indent}/, '') if indent > 0
152
+
153
+ add_line_numbers(src) if self.class.add_line_numbers
124
154
 
125
155
  src
126
156
  end
@@ -133,6 +163,12 @@ class RDoc::Attr
133
163
 
134
164
  end
135
165
 
166
+ class RDoc::Alias
167
+
168
+ include RDoc::Generator::Markup
169
+
170
+ end
171
+
136
172
  class RDoc::Constant
137
173
 
138
174
  include RDoc::Generator::Markup
@@ -8,10 +8,6 @@ class RDoc::Generator::RI
8
8
 
9
9
  RDoc::RDoc.add_generator self
10
10
 
11
- def self.for options
12
- new options
13
- end
14
-
15
11
  ##
16
12
  # Set up a new ri generator
17
13
 
@@ -20,6 +16,8 @@ class RDoc::Generator::RI
20
16
  @store = RDoc::RI::Store.new '.'
21
17
  @old_siginfo = nil
22
18
  @current = nil
19
+
20
+ @store.dry_run = @options.dry_run
23
21
  end
24
22
 
25
23
  ##
@@ -29,6 +27,8 @@ class RDoc::Generator::RI
29
27
  def generate top_levels
30
28
  install_siginfo_handler
31
29
 
30
+ @store.load_cache
31
+
32
32
  RDoc::TopLevel.all_classes_and_modules.each do |klass|
33
33
  @current = "#{klass.class}: #{klass.full_name}"
34
34
 
@@ -1,296 +1,289 @@
1
- <?xml version="1.0" encoding="utf-8"?>
1
+ <?xml version="1.0" encoding="<%= @options.charset %>"?>
2
2
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
4
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
5
  <head>
6
- <meta content="text/html; charset=<%= @options.charset %>" http-equiv="Content-Type" />
6
+ <meta content="text/html; charset=<%= @options.charset %>" http-equiv="Content-Type" />
7
7
 
8
- <title><%= klass.type.capitalize %>: <%= klass.full_name %></title>
8
+ <title><%= klass.type.capitalize %>: <%= klass.full_name %></title>
9
9
 
10
- <link rel="stylesheet" href="<%= rel_prefix %>/rdoc.css" type="text/css" media="screen" />
10
+ <link rel="stylesheet" href="<%= rel_prefix %>/rdoc.css" type="text/css" media="screen" />
11
11
 
12
- <script src="<%= rel_prefix %>/js/jquery.js" type="text/javascript"
13
- charset="utf-8"></script>
14
- <script src="<%= rel_prefix %>/js/thickbox-compressed.js" type="text/javascript"
15
- charset="utf-8"></script>
16
- <script src="<%= rel_prefix %>/js/quicksearch.js" type="text/javascript"
17
- charset="utf-8"></script>
18
- <script src="<%= rel_prefix %>/js/darkfish.js" type="text/javascript"
19
- charset="utf-8"></script>
12
+ <script src="<%= rel_prefix %>/js/jquery.js" type="text/javascript"
13
+ charset="utf-8"></script>
14
+ <script src="<%= rel_prefix %>/js/thickbox-compressed.js" type="text/javascript"
15
+ charset="utf-8"></script>
16
+ <script src="<%= rel_prefix %>/js/quicksearch.js" type="text/javascript"
17
+ charset="utf-8"></script>
18
+ <script src="<%= rel_prefix %>/js/darkfish.js" type="text/javascript"
19
+ charset="utf-8"></script>
20
20
 
21
21
  </head>
22
22
  <body class="<%= klass.type %>">
23
23
 
24
- <div id="metadata">
25
- <div id="home-metadata">
26
- <div id="home-section" class="section">
24
+ <div id="metadata">
25
+ <div id="home-metadata">
26
+ <div id="home-section" class="section">
27
27
  <h3 class="section-header">
28
28
  <a href="<%= rel_prefix %>/index.html">Home</a>
29
29
  <a href="<%= rel_prefix %>/index.html#classes">Classes</a>
30
30
  <a href="<%= rel_prefix %>/index.html#methods">Methods</a>
31
31
  </h3>
32
- </div>
33
- </div>
34
-
35
- <div id="file-metadata">
36
- <div id="file-list-section" class="section">
37
- <h3 class="section-header">In Files</h3>
38
- <div class="section-body">
39
- <ul>
40
- <% klass.in_files.each do |tl| %>
41
- <li><a href="<%= rel_prefix %>/<%= h tl.path %>?TB_iframe=true&amp;height=550&amp;width=785"
42
- class="thickbox" title="<%= h tl.absolute_name %>"><%= h tl.absolute_name %></a></li>
43
- <% end %>
44
- </ul>
45
- </div>
46
- </div>
47
-
48
- <% if !svninfo.empty? %>
49
- <div id="file-svninfo-section" class="section">
50
- <h3 class="section-header">Subversion Info</h3>
51
- <div class="section-body">
52
- <dl class="svninfo">
53
- <dt>Rev</dt>
54
- <dd><%= svninfo[:rev] %></dd>
55
-
56
- <dt>Last Checked In</dt>
57
- <dd><%= svninfo[:commitdate].strftime('%Y-%m-%d %H:%M:%S') %>
58
- (<%= svninfo[:commitdelta] %> ago)</dd>
59
-
60
- <dt>Checked in by</dt>
61
- <dd><%= svninfo[:committer] %></dd>
62
- </dl>
63
- </div>
64
- </div>
65
- <% end %>
66
- </div>
67
-
68
- <div id="class-metadata">
69
-
70
- <!-- Parent Class -->
71
- <% if klass.type == 'class' %>
72
- <div id="parent-class-section" class="section">
73
- <h3 class="section-header">Parent</h3>
74
- <% unless String === klass.superclass %>
75
- <p class="link"><a href="<%= klass.aref_to klass.superclass.path %>"><%= klass.superclass.full_name %></a></p>
76
- <% else %>
77
- <p class="link"><%= klass.superclass %></p>
78
- <% end %>
79
- </div>
80
- <% end %>
81
-
82
- <!-- Namespace Contents -->
83
- <% unless klass.classes_and_modules.empty? %>
84
- <div id="namespace-list-section" class="section">
85
- <h3 class="section-header">Namespace</h3>
86
- <ul class="link-list">
87
- <% (klass.modules.sort + klass.classes.sort).each do |mod| %>
88
- <li><span class="type"><%= mod.type.upcase %></span> <a href="<%= klass.aref_to mod.path %>"><%= mod.full_name %></a></li>
89
- <% end %>
90
- </ul>
91
- </div>
92
- <% end %>
93
-
94
- <!-- Method Quickref -->
95
- <% unless klass.method_list.empty? %>
96
- <div id="method-list-section" class="section">
97
- <h3 class="section-header">Methods</h3>
98
- <ul class="link-list">
99
- <% klass.each_method do |meth| %>
100
- <li><a href="#<%= meth.aref %>"><%= meth.singleton ? '::' : '#' %><%= meth.name %></a></li>
101
- <% end %>
102
- </ul>
103
- </div>
104
- <% end %>
105
-
106
- <!-- Included Modules -->
107
- <% unless klass.includes.empty? %>
108
- <div id="includes-section" class="section">
109
- <h3 class="section-header">Included Modules</h3>
110
- <ul class="link-list">
111
- <% klass.each_include do |inc| %>
112
- <% unless String === inc.module %>
113
- <li><a class="include" href="<%= klass.aref_to inc.module.path %>"><%= inc.module.full_name %></a></li>
114
- <% else %>
115
- <li><span class="include"><%= inc.name %></span></li>
116
- <% end %>
117
- <% end %>
118
- </ul>
119
- </div>
120
- <% end %>
121
- </div>
122
-
123
- <div id="project-metadata">
124
- <% simple_files = @files.select {|tl| tl.parser == RDoc::Parser::Simple } %>
125
- <% unless simple_files.empty? then %>
126
- <div id="fileindex-section" class="section project-section">
127
- <h3 class="section-header">Files</h3>
128
- <ul>
129
- <% simple_files.each do |file| %>
130
- <li class="file"><a href="<%= rel_prefix %>/<%= file.path %>"><%= h file.base_name %></a></li>
131
- <% end %>
132
- </ul>
133
- </div>
134
- <% end %>
135
-
136
- <div id="classindex-section" class="section project-section">
137
- <h3 class="section-header">Class Index
138
- <span class="search-toggle"><img src="<%= rel_prefix %>/images/find.png"
139
- height="16" width="16" alt="[+]"
140
- title="show/hide quicksearch" /></span></h3>
141
- <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
142
- <fieldset>
143
- <legend>Quicksearch</legend>
144
- <input type="text" name="quicksearch" value=""
145
- class="quicksearch-field" />
146
- </fieldset>
147
- </form>
148
-
149
- <ul class="link-list">
150
- <% @modsort.each do |index_klass| %>
151
- <li><a href="<%= rel_prefix %>/<%= index_klass.path %>"><%= index_klass.full_name %></a></li>
152
- <% end %>
153
- </ul>
154
- <div id="no-class-search-results" style="display: none;">No matching classes.</div>
155
- </div>
156
-
157
- <% if $DEBUG_RDOC %>
158
- <div id="debugging-toggle"><img src="<%= rel_prefix %>/images/bug.png"
159
- alt="toggle debugging" height="16" width="16" /></div>
160
- <% end %>
161
- </div>
162
- </div>
163
-
164
- <div id="documentation">
165
- <h1 class="<%= klass.type %>"><%= klass.full_name %></h1>
166
-
167
- <div id="description">
168
- <%= klass.description %>
169
- </div>
170
-
171
- <!-- Constants -->
172
- <% unless klass.constants.empty? %>
173
- <div id="constants-list" class="section">
174
- <h3 class="section-header">Constants</h3>
175
- <dl>
176
- <% klass.each_constant do |const| %>
177
- <dt><a name="<%= const.name %>"><%= const.name %></a></dt>
178
- <% if const.comment %>
179
- <dd class="description"><%= const.description.strip %></dd>
180
- <% else %>
181
- <dd class="description missing-docs">(Not documented)</dd>
182
- <% end %>
183
- <% end %>
184
- </dl>
185
- </div>
186
- <% end %>
187
-
188
- <!-- Attributes -->
189
- <% unless klass.attributes.empty? %>
190
- <div id="attribute-method-details" class="method-section section">
191
- <h3 class="section-header">Attributes</h3>
192
-
193
- <% klass.each_attribute do |attrib| %>
194
- <div id="<%= attrib.html_name %>-attribute-method" class="method-detail">
195
- <a name="<%= h attrib.name %>"></a>
196
- <% if attrib.rw =~ /w/i %>
197
- <a name="<%= h attrib.name %>="></a>
198
- <% end %>
199
- <div class="method-heading attribute-method-heading">
200
- <span class="method-name"><%= h attrib.name %></span><span
201
- class="attribute-access-type">[<%= attrib.rw %>]</span>
202
- </div>
203
-
204
- <div class="method-description">
205
- <% if attrib.comment %>
206
- <%= attrib.description.strip %>
207
- <% else %>
208
- <p class="missing-docs">(Not documented)</p>
209
- <% end %>
210
- </div>
211
- </div>
212
- <% end %>
213
- </div>
214
- <% end %>
215
-
216
- <!-- Methods -->
217
- <% klass.methods_by_type.each do |type, visibilities|
218
- next if visibilities.empty?
219
- visibilities.each do |visibility, methods|
220
- next if methods.empty? %>
221
- <div id="<%= visibility %>-<%= type %>-method-details" class="method-section section">
222
- <h3 class="section-header"><%= visibility.to_s.capitalize %> <%= type.capitalize %> Methods</h3>
223
-
224
- <% methods.each do |method| %>
225
- <div id="<%= method.html_name %>-method" class="method-detail <%= method.is_alias_for ? "method-alias" : '' %>">
226
- <a name="<%= h method.aref %>"></a>
227
-
228
- <div class="method-heading">
229
- <% if method.call_seq %>
230
- <span class="method-callseq"><%= method.call_seq.strip.gsub(/->/, '&rarr;').gsub( /^\w.+\./m, '') %></span>
231
- <span class="method-click-advice">click to toggle source</span>
232
- <% else %>
233
- <span class="method-name"><%= h method.name %></span><span
234
- class="method-args"><%= method.params %></span>
235
- <span class="method-click-advice">click to toggle source</span>
236
- <% end %>
237
- </div>
238
-
239
- <div class="method-description">
240
- <% if method.comment %>
241
- <%= method.description.strip %>
242
- <% else %>
243
- <p class="missing-docs">(Not documented)</p>
244
- <% end %>
245
-
246
- <% if method.token_stream %>
247
- <div class="method-source-code"
248
- id="<%= method.html_name %>-source">
32
+ </div>
33
+ </div>
34
+
35
+ <div id="file-metadata">
36
+ <div id="file-list-section" class="section">
37
+ <h3 class="section-header">In Files</h3>
38
+ <div class="section-body">
39
+ <ul>
40
+ <% klass.in_files.each do |tl| %>
41
+ <li><a href="<%= rel_prefix %>/<%= h tl.path %>?TB_iframe=true&amp;height=550&amp;width=785"
42
+ class="thickbox" title="<%= h tl.absolute_name %>"><%= h tl.absolute_name %></a></li>
43
+ <% end %>
44
+ </ul>
45
+ </div>
46
+ </div>
47
+
48
+ <% if !svninfo.empty? %>
49
+ <div id="file-svninfo-section" class="section">
50
+ <h3 class="section-header">Subversion Info</h3>
51
+ <div class="section-body">
52
+ <dl class="svninfo">
53
+ <dt>Rev</dt>
54
+ <dd><%= svninfo[:rev] %></dd>
55
+
56
+ <dt>Last Checked In</dt>
57
+ <dd><%= svninfo[:commitdate].strftime('%Y-%m-%d %H:%M:%S') %>
58
+ (<%= svninfo[:commitdelta] %> ago)</dd>
59
+
60
+ <dt>Checked in by</dt>
61
+ <dd><%= svninfo[:committer] %></dd>
62
+ </dl>
63
+ </div>
64
+ </div>
65
+ <% end %>
66
+ </div>
67
+
68
+ <div id="class-metadata">
69
+
70
+ <!-- Parent Class -->
71
+ <% if klass.type == 'class' %>
72
+ <div id="parent-class-section" class="section">
73
+ <h3 class="section-header">Parent</h3>
74
+ <% if klass.superclass and not String === klass.superclass then %>
75
+ <p class="link"><a href="<%= klass.aref_to klass.superclass.path %>"><%= klass.superclass.full_name %></a></p>
76
+ <% else %>
77
+ <p class="link"><%= klass.superclass %></p>
78
+ <% end %>
79
+ </div>
80
+ <% end %>
81
+
82
+ <!-- Namespace Contents -->
83
+ <% unless klass.classes_and_modules.empty? %>
84
+ <div id="namespace-list-section" class="section">
85
+ <h3 class="section-header">Namespace</h3>
86
+ <ul class="link-list">
87
+ <% (klass.modules.sort + klass.classes.sort).each do |mod| %>
88
+ <li><span class="type"><%= mod.type.upcase %></span> <a href="<%= klass.aref_to mod.path %>"><%= mod.full_name %></a></li>
89
+ <% end %>
90
+ </ul>
91
+ </div>
92
+ <% end %>
93
+
94
+ <!-- Method Quickref -->
95
+ <% unless klass.method_list.empty? %>
96
+ <div id="method-list-section" class="section">
97
+ <h3 class="section-header">Methods</h3>
98
+ <ul class="link-list">
99
+ <% klass.each_method do |meth| %>
100
+ <li><a href="#<%= meth.aref %>"><%= meth.singleton ? '::' : '#' %><%= meth.name %></a></li>
101
+ <% end %>
102
+ </ul>
103
+ </div>
104
+ <% end %>
105
+
106
+ <!-- Included Modules -->
107
+ <% unless klass.includes.empty? %>
108
+ <div id="includes-section" class="section">
109
+ <h3 class="section-header">Included Modules</h3>
110
+ <ul class="link-list">
111
+ <% klass.each_include do |inc| %>
112
+ <% unless String === inc.module %>
113
+ <li><a class="include" href="<%= klass.aref_to inc.module.path %>"><%= inc.module.full_name %></a></li>
114
+ <% else %>
115
+ <li><span class="include"><%= inc.name %></span></li>
116
+ <% end %>
117
+ <% end %>
118
+ </ul>
119
+ </div>
120
+ <% end %>
121
+ </div>
122
+
123
+ <div id="project-metadata">
124
+ <% simple_files = @files.select {|tl| tl.parser == RDoc::Parser::Simple } %>
125
+ <% unless simple_files.empty? then %>
126
+ <div id="fileindex-section" class="section project-section">
127
+ <h3 class="section-header">Files</h3>
128
+ <ul>
129
+ <% simple_files.each do |file| %>
130
+ <li class="file"><a href="<%= rel_prefix %>/<%= file.path %>"><%= h file.base_name %></a></li>
131
+ <% end %>
132
+ </ul>
133
+ </div>
134
+ <% end %>
135
+
136
+ <div id="classindex-section" class="section project-section">
137
+ <h3 class="section-header">Class Index
138
+ <span class="search-toggle"><img src="<%= rel_prefix %>/images/find.png"
139
+ height="16" width="16" alt="[+]"
140
+ title="show/hide quicksearch" /></span></h3>
141
+ <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
142
+ <fieldset>
143
+ <legend>Quicksearch</legend>
144
+ <input type="text" name="quicksearch" value=""
145
+ class="quicksearch-field" />
146
+ </fieldset>
147
+ </form>
148
+
149
+ <ul class="link-list">
150
+ <% @modsort.each do |index_klass| %>
151
+ <li><a href="<%= rel_prefix %>/<%= index_klass.path %>"><%= index_klass.full_name %></a></li>
152
+ <% end %>
153
+ </ul>
154
+ <div id="no-class-search-results" style="display: none;">No matching classes.</div>
155
+ </div>
156
+
157
+ <% if $DEBUG_RDOC %>
158
+ <div id="debugging-toggle"><img src="<%= rel_prefix %>/images/bug.png"
159
+ alt="toggle debugging" height="16" width="16" /></div>
160
+ <% end %>
161
+ </div>
162
+ </div>
163
+
164
+ <div id="documentation">
165
+ <h1 class="<%= klass.type %>"><%= klass.full_name %></h1>
166
+
167
+ <div id="description">
168
+ <%= klass.description %>
169
+ </div>
170
+
171
+ <!-- Constants -->
172
+ <% unless klass.constants.empty? %>
173
+ <div id="constants-list" class="section">
174
+ <h3 class="section-header">Constants</h3>
175
+ <dl>
176
+ <% klass.each_constant do |const| %>
177
+ <dt><a name="<%= const.name %>"><%= const.name %></a></dt>
178
+ <% if const.comment %>
179
+ <dd class="description"><%= const.description.strip %></dd>
180
+ <% else %>
181
+ <dd class="description missing-docs">(Not documented)</dd>
182
+ <% end %>
183
+ <% end %>
184
+ </dl>
185
+ </div>
186
+ <% end %>
187
+
188
+ <!-- Attributes -->
189
+ <% unless klass.attributes.empty? %>
190
+ <div id="attribute-method-details" class="method-section section">
191
+ <h3 class="section-header">Attributes</h3>
192
+
193
+ <% klass.each_attribute do |attrib| %>
194
+ <div id="<%= attrib.html_name %>-attribute-method" class="method-detail">
195
+ <a name="<%= h attrib.name %>"></a>
196
+ <% if attrib.rw =~ /w/i %>
197
+ <a name="<%= h attrib.name %>="></a>
198
+ <% end %>
199
+ <div class="method-heading attribute-method-heading">
200
+ <span class="method-name"><%= h attrib.name %></span><span
201
+ class="attribute-access-type">[<%= attrib.rw %>]</span>
202
+ </div>
203
+
204
+ <div class="method-description">
205
+ <% if attrib.comment %>
206
+ <%= attrib.description.strip %>
207
+ <% else %>
208
+ <p class="missing-docs">(Not documented)</p>
209
+ <% end %>
210
+ </div>
211
+ </div>
212
+ <% end %>
213
+ </div>
214
+ <% end %>
215
+
216
+ <!-- Methods -->
217
+ <% klass.methods_by_type.each do |type, visibilities|
218
+ next if visibilities.empty?
219
+ visibilities.each do |visibility, methods|
220
+ next if methods.empty? %>
221
+ <div id="<%= visibility %>-<%= type %>-method-details" class="method-section section">
222
+ <h3 class="section-header"><%= visibility.to_s.capitalize %> <%= type.capitalize %> Methods</h3>
223
+
224
+ <% methods.each do |method| %>
225
+ <div id="<%= method.html_name %>-method" class="method-detail <%= method.is_alias_for ? "method-alias" : '' %>">
226
+ <a name="<%= h method.aref %>"></a>
227
+
228
+ <div class="method-heading">
229
+ <% if method.call_seq %>
230
+ <span class="method-callseq"><%= method.call_seq.strip.gsub(/->/, '&rarr;').gsub( /^\w.+\./m, '') %></span>
231
+ <span class="method-click-advice">click to toggle source</span>
232
+ <% else %>
233
+ <span class="method-name"><%= h method.name %></span><span
234
+ class="method-args"><%= method.params %></span>
235
+ <span class="method-click-advice">click to toggle source</span>
236
+ <% end %>
237
+ </div>
238
+
239
+ <div class="method-description">
240
+ <% if method.comment %>
241
+ <%= method.description.strip %>
242
+ <% else %>
243
+ <p class="missing-docs">(Not documented)</p>
244
+ <% end %>
245
+
246
+ <% if method.token_stream %>
247
+ <div class="method-source-code"
248
+ id="<%= method.html_name %>-source">
249
249
  <pre>
250
250
  <%= method.markup_code %>
251
251
  </pre>
252
- </div>
253
- <% end %>
254
- </div>
255
-
256
- <% unless method.aliases.empty? %>
257
- <div class="aliases">
258
- Also aliased as: <%= method.aliases.map do |aka|
259
- %{<a href="#{ klass.aref_to aka.path}">#{h aka.name}</a>}
260
- end.join(", ") %>
261
- </div>
262
- <% end %>
263
-
264
- <% if method.is_alias_for then %>
265
- <div class="aliases">
252
+ </div>
253
+ <% end %>
254
+ </div>
255
+
256
+ <% unless method.aliases.empty? %>
257
+ <div class="aliases">
258
+ Also aliased as: <%= method.aliases.map do |aka|
259
+ if aka.parent then # HACK lib/rexml/encodings
260
+ %{<a href="#{klass.aref_to aka.path}">#{h aka.name}</a>}
261
+ else
262
+ h aka.name
263
+ end
264
+ end.join ", " %>
265
+ </div>
266
+ <% end %>
267
+
268
+ <% if method.is_alias_for then %>
269
+ <div class="aliases">
266
270
  Alias for: <a href="<%= klass.aref_to method.is_alias_for.path %>"><%= h method.is_alias_for.name %></a>
267
- </div>
268
- <% end %>
269
- </div>
270
-
271
- <% end %>
272
- </div>
273
- <% end
274
- end %>
275
-
276
- </div>
277
-
278
-
279
- <div id="rdoc-debugging-section-dump" class="debugging-section">
280
- <% if $DEBUG_RDOC
281
- require 'pp' %>
282
- <pre><%= h PP.pp(klass, _erbout) %></pre>
283
- </div>
284
- <% else %>
285
- <p>Disabled; run with --debug to generate this.</p>
286
- <% end %>
287
- </div>
288
-
289
- <div id="validator-badges">
290
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
291
- <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
292
- Rdoc Generator</a> <%= RDoc::Generator::Darkfish::VERSION %></small>.</p>
293
- </div>
271
+ </div>
272
+ <% end %>
273
+ </div>
274
+
275
+ <% end %>
276
+ </div>
277
+ <% end
278
+ end %>
279
+
280
+ </div>
281
+
282
+ <div id="validator-badges">
283
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
284
+ <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
285
+ Rdoc Generator</a> <%= RDoc::Generator::Darkfish::VERSION %></small>.</p>
286
+ </div>
294
287
 
295
288
  </body>
296
289
  </html>