rdoc 8.0.0 → 8.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTING.md +1 -3
  3. data/RI.md +75 -75
  4. data/exe/rdoc +2 -2
  5. data/lib/rdoc/code_object/alias.rb +71 -69
  6. data/lib/rdoc/code_object/any_method.rb +305 -303
  7. data/lib/rdoc/code_object/attr.rb +150 -148
  8. data/lib/rdoc/code_object/class_module.rb +798 -792
  9. data/lib/rdoc/code_object/constant.rb +175 -173
  10. data/lib/rdoc/code_object/context/section.rb +142 -138
  11. data/lib/rdoc/code_object/context.rb +926 -958
  12. data/lib/rdoc/code_object/extend.rb +7 -5
  13. data/lib/rdoc/code_object/include.rb +7 -5
  14. data/lib/rdoc/code_object/method_attr.rb +326 -319
  15. data/lib/rdoc/code_object/mixin.rb +97 -95
  16. data/lib/rdoc/code_object/normal_class.rb +77 -78
  17. data/lib/rdoc/code_object/normal_module.rb +61 -59
  18. data/lib/rdoc/code_object/require.rb +23 -39
  19. data/lib/rdoc/code_object/single_class.rb +21 -19
  20. data/lib/rdoc/code_object/top_level.rb +212 -219
  21. data/lib/rdoc/code_object.rb +305 -303
  22. data/lib/rdoc/comment.rb +275 -273
  23. data/lib/rdoc/cross_reference.rb +192 -190
  24. data/lib/rdoc/encoding.rb +105 -103
  25. data/lib/rdoc/erb_partial.rb +13 -11
  26. data/lib/rdoc/erbio.rb +29 -27
  27. data/lib/rdoc/generator/aliki.rb +161 -153
  28. data/lib/rdoc/generator/darkfish.rb +645 -635
  29. data/lib/rdoc/generator/json_index.rb +233 -229
  30. data/lib/rdoc/generator/markup.rb +164 -146
  31. data/lib/rdoc/generator/pot/message_extractor.rb +57 -51
  32. data/lib/rdoc/generator/pot/po.rb +52 -51
  33. data/lib/rdoc/generator/pot/po_entry.rb +138 -132
  34. data/lib/rdoc/generator/pot.rb +85 -81
  35. data/lib/rdoc/generator/ri.rb +23 -19
  36. data/lib/rdoc/generator/template/aliki/DESIGN.md +6 -4
  37. data/lib/rdoc/generator/template/aliki/_footer.rhtml +1 -1
  38. data/lib/rdoc/generator/template/aliki/_head.rhtml +10 -10
  39. data/lib/rdoc/generator/template/aliki/_header.rhtml +29 -44
  40. data/lib/rdoc/generator/template/aliki/_sidebar_search.rhtml +4 -4
  41. data/lib/rdoc/generator/template/aliki/css/rdoc.css +207 -178
  42. data/lib/rdoc/generator/template/aliki/js/aliki.js +60 -84
  43. data/lib/rdoc/generator/template/darkfish/_footer.rhtml +1 -1
  44. data/lib/rdoc/generator.rb +48 -46
  45. data/lib/rdoc/i18n/locale.rb +99 -95
  46. data/lib/rdoc/i18n/text.rb +109 -105
  47. data/lib/rdoc/i18n.rb +7 -5
  48. data/lib/rdoc/markdown/byte_runtime.rb +80 -0
  49. data/lib/rdoc/markdown.kpeg +15 -11
  50. data/lib/rdoc/markdown.rb +40 -47
  51. data/lib/rdoc/markup/block_quote.rb +12 -8
  52. data/lib/rdoc/markup/document.rb +127 -123
  53. data/lib/rdoc/markup/formatter.rb +219 -215
  54. data/lib/rdoc/markup/include.rb +33 -29
  55. data/lib/rdoc/markup/indented_paragraph.rb +37 -33
  56. data/lib/rdoc/markup/inline_parser.rb +281 -277
  57. data/lib/rdoc/markup/list.rb +80 -88
  58. data/lib/rdoc/markup/list_item.rb +73 -85
  59. data/lib/rdoc/markup/paragraph.rb +23 -19
  60. data/lib/rdoc/markup/parser.rb +501 -497
  61. data/lib/rdoc/markup/pre_process.rb +283 -279
  62. data/lib/rdoc/markup/raw.rb +2 -2
  63. data/lib/rdoc/markup/rule.rb +16 -12
  64. data/lib/rdoc/markup/to_ansi.rb +143 -139
  65. data/lib/rdoc/markup/to_bs.rb +72 -68
  66. data/lib/rdoc/markup/to_html.rb +594 -565
  67. data/lib/rdoc/markup/to_html_crossref.rb +234 -230
  68. data/lib/rdoc/markup/to_html_snippet.rb +232 -227
  69. data/lib/rdoc/markup/to_joined_paragraph.rb +36 -32
  70. data/lib/rdoc/markup/to_label.rb +63 -59
  71. data/lib/rdoc/markup/to_markdown.rb +212 -208
  72. data/lib/rdoc/markup/to_rdoc.rb +336 -332
  73. data/lib/rdoc/markup/to_table_of_contents.rb +66 -62
  74. data/lib/rdoc/markup/to_test.rb +60 -56
  75. data/lib/rdoc/markup/to_tt_only.rb +84 -80
  76. data/lib/rdoc/markup/verbatim.rb +62 -58
  77. data/lib/rdoc/markup.rb +198 -196
  78. data/lib/rdoc/options.rb +1063 -1061
  79. data/lib/rdoc/parser/c.rb +1039 -1037
  80. data/lib/rdoc/parser/changelog.rb +319 -315
  81. data/lib/rdoc/parser/markdown.rb +17 -13
  82. data/lib/rdoc/parser/rbs.rb +239 -235
  83. data/lib/rdoc/parser/rd.rb +17 -13
  84. data/lib/rdoc/parser/ruby.rb +1245 -1124
  85. data/lib/rdoc/parser/ruby_colorizer.rb +263 -213
  86. data/lib/rdoc/parser/simple.rb +31 -27
  87. data/lib/rdoc/parser/text.rb +12 -8
  88. data/lib/rdoc/parser.rb +228 -220
  89. data/lib/rdoc/rbs_helper.rb +1 -1
  90. data/lib/rdoc/rd/inline.rb +57 -53
  91. data/lib/rdoc/rd.rb +90 -88
  92. data/lib/rdoc/rdoc.rb +500 -491
  93. data/lib/rdoc/ri/driver.rb +1140 -1135
  94. data/lib/rdoc/ri/formatter.rb +7 -3
  95. data/lib/rdoc/ri/paths.rb +140 -136
  96. data/lib/rdoc/ri/servlet.rb +354 -350
  97. data/lib/rdoc/ri/store.rb +4 -2
  98. data/lib/rdoc/ri/task.rb +55 -51
  99. data/lib/rdoc/ri.rb +14 -12
  100. data/lib/rdoc/rubygems_hook.rb +183 -181
  101. data/lib/rdoc/server.rb +349 -347
  102. data/lib/rdoc/stats/normal.rb +46 -42
  103. data/lib/rdoc/stats/quiet.rb +39 -35
  104. data/lib/rdoc/stats/verbose.rb +35 -31
  105. data/lib/rdoc/stats.rb +365 -363
  106. data/lib/rdoc/store.rb +888 -902
  107. data/lib/rdoc/task.rb +260 -256
  108. data/lib/rdoc/text.rb +135 -133
  109. data/lib/rdoc/token_stream.rb +101 -93
  110. data/lib/rdoc/tom_doc.rb +203 -201
  111. data/lib/rdoc/version.rb +1 -1
  112. metadata +4 -5
  113. data/lib/rdoc/markdown/literals.kpeg +0 -21
  114. data/lib/rdoc/markdown/literals.rb +0 -454
@@ -5,280 +5,284 @@ begin
5
5
  rescue LoadError
6
6
  end
7
7
 
8
- ##
9
- # The JsonIndex generator is designed to complement an HTML generator and
10
- # produces a JSON search index. This generator is derived from sdoc by
11
- # Vladimir Kolesnikov and contains verbatim code written by him.
12
- #
13
- # This generator is designed to be used with a regular HTML generator:
14
- #
15
- # class RDoc::Generator::Darkfish
16
- # def initialize options
17
- # # ...
18
- # @base_dir = Pathname.pwd.expand_path
19
- #
20
- # @json_index = RDoc::Generator::JsonIndex.new self, options
21
- # end
22
- #
23
- # def generate
24
- # # ...
25
- # @json_index.generate
26
- # end
27
- # end
28
- #
29
- # == Index Format
30
- #
31
- # The index is output as a JSON file assigned to the global variable
32
- # +search_data+. The structure is:
33
- #
34
- # var search_data = {
35
- # "index": {
36
- # "searchIndex":
37
- # ["a", "b", ...],
38
- # "longSearchIndex":
39
- # ["a", "a::b", ...],
40
- # "info": [
41
- # ["A", "A", "A.html", "", ""],
42
- # ["B", "A::B", "A::B.html", "", ""],
43
- # ...
44
- # ]
45
- # }
46
- # }
47
- #
48
- # The same item is described across the +searchIndex+, +longSearchIndex+ and
49
- # +info+ fields. The +searchIndex+ field contains the item's short name, the
50
- # +longSearchIndex+ field contains the full_name (when appropriate) and the
51
- # +info+ field contains the item's name, full_name, path, parameters and a
52
- # snippet of the item's comment.
53
- #
54
- # == LICENSE
55
- #
56
- # Copyright (c) 2009 Vladimir Kolesnikov
57
- #
58
- # Permission is hereby granted, free of charge, to any person obtaining
59
- # a copy of this software and associated documentation files (the
60
- # "Software"), to deal in the Software without restriction, including
61
- # without limitation the rights to use, copy, modify, merge, publish,
62
- # distribute, sublicense, and/or sell copies of the Software, and to
63
- # permit persons to whom the Software is furnished to do so, subject to
64
- # the following conditions:
65
- #
66
- # The above copyright notice and this permission notice shall be
67
- # included in all copies or substantial portions of the Software.
68
- #
69
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
70
- # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
71
- # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
72
- # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
73
- # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
74
- # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
75
- # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
76
-
77
- class RDoc::Generator::JsonIndex
78
-
79
- include RDoc::Text
80
-
81
- ##
82
- # Where the search index lives in the generated output
83
-
84
- SEARCH_INDEX_FILE = File.join 'js', 'search_index.js'
85
-
86
- attr_reader :index # :nodoc:
87
-
88
- ##
89
- # Creates a new generator.
90
- # +options+ are the same options passed to the parent generator.
91
-
92
- def initialize(parent_generator, options)
93
- @parent_generator = parent_generator
94
- @store = parent_generator.store
95
- @options = options
96
-
97
- @template_dir = File.expand_path '../template/json_index', __FILE__
98
- @base_dir = @parent_generator.base_dir
99
-
100
- @classes = nil
101
- @files = nil
102
- @index = nil
103
- end
8
+ module RDoc
9
+ module Generator
10
+ ##
11
+ # The JsonIndex generator is designed to complement an HTML generator and
12
+ # produces a JSON search index. This generator is derived from sdoc by
13
+ # Vladimir Kolesnikov and contains verbatim code written by him.
14
+ #
15
+ # This generator is designed to be used with a regular HTML generator:
16
+ #
17
+ # class RDoc::Generator::Darkfish
18
+ # def initialize options
19
+ # # ...
20
+ # @base_dir = Pathname.pwd.expand_path
21
+ #
22
+ # @json_index = RDoc::Generator::JsonIndex.new self, options
23
+ # end
24
+ #
25
+ # def generate
26
+ # # ...
27
+ # @json_index.generate
28
+ # end
29
+ # end
30
+ #
31
+ # == Index Format
32
+ #
33
+ # The index is output as a JSON file assigned to the global variable
34
+ # +search_data+. The structure is:
35
+ #
36
+ # var search_data = {
37
+ # "index": {
38
+ # "searchIndex":
39
+ # ["a", "b", ...],
40
+ # "longSearchIndex":
41
+ # ["a", "a::b", ...],
42
+ # "info": [
43
+ # ["A", "A", "A.html", "", ""],
44
+ # ["B", "A::B", "A::B.html", "", ""],
45
+ # ...
46
+ # ]
47
+ # }
48
+ # }
49
+ #
50
+ # The same item is described across the +searchIndex+, +longSearchIndex+ and
51
+ # +info+ fields. The +searchIndex+ field contains the item's short name, the
52
+ # +longSearchIndex+ field contains the full_name (when appropriate) and the
53
+ # +info+ field contains the item's name, full_name, path, parameters and a
54
+ # snippet of the item's comment.
55
+ #
56
+ # == LICENSE
57
+ #
58
+ # Copyright (c) 2009 Vladimir Kolesnikov
59
+ #
60
+ # Permission is hereby granted, free of charge, to any person obtaining
61
+ # a copy of this software and associated documentation files (the
62
+ # "Software"), to deal in the Software without restriction, including
63
+ # without limitation the rights to use, copy, modify, merge, publish,
64
+ # distribute, sublicense, and/or sell copies of the Software, and to
65
+ # permit persons to whom the Software is furnished to do so, subject to
66
+ # the following conditions:
67
+ #
68
+ # The above copyright notice and this permission notice shall be
69
+ # included in all copies or substantial portions of the Software.
70
+ #
71
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
72
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
73
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
74
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
75
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
76
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
77
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
78
+
79
+ class JsonIndex
80
+
81
+ include Text
82
+
83
+ ##
84
+ # Where the search index lives in the generated output
85
+
86
+ SEARCH_INDEX_FILE = File.join 'js', 'search_index.js'
87
+
88
+ attr_reader :index # :nodoc:
89
+
90
+ ##
91
+ # Creates a new generator.
92
+ # +options+ are the same options passed to the parent generator.
93
+
94
+ def initialize(parent_generator, options)
95
+ @parent_generator = parent_generator
96
+ @store = parent_generator.store
97
+ @options = options
98
+
99
+ @template_dir = File.expand_path '../template/json_index', __FILE__
100
+ @base_dir = @parent_generator.base_dir
101
+
102
+ @classes = nil
103
+ @files = nil
104
+ @index = nil
105
+ end
104
106
 
105
- ##
106
- # Builds the JSON index as a Hash.
107
+ ##
108
+ # Builds the JSON index as a Hash.
107
109
 
108
- def build_index
109
- reset @store.all_files.sort, @store.all_classes_and_modules.sort
110
+ def build_index
111
+ reset @store.all_files.sort, @store.all_classes_and_modules.sort
110
112
 
111
- index_classes
112
- index_methods
113
- index_pages
113
+ index_classes
114
+ index_methods
115
+ index_pages
114
116
 
115
- { :index => @index }
116
- end
117
+ { :index => @index }
118
+ end
117
119
 
118
- ##
119
- # Output progress information if debugging is enabled
120
+ ##
121
+ # Output progress information if debugging is enabled
120
122
 
121
- def debug_msg(*msg)
122
- return unless $DEBUG_RDOC
123
- $stderr.puts(*msg)
124
- end
123
+ def debug_msg(*msg)
124
+ return unless $DEBUG_RDOC
125
+ $stderr.puts(*msg)
126
+ end
125
127
 
126
- ##
127
- # Writes the JSON index to disk
128
+ ##
129
+ # Writes the JSON index to disk
128
130
 
129
- def generate
130
- debug_msg "Generating JSON index"
131
+ def generate
132
+ debug_msg "Generating JSON index"
131
133
 
132
- debug_msg " writing search index to %s" % SEARCH_INDEX_FILE
133
- data = build_index
134
+ debug_msg " writing search index to %s" % SEARCH_INDEX_FILE
135
+ data = build_index
134
136
 
135
- return if @options.dry_run
137
+ return if @options.dry_run
136
138
 
137
- out_dir = @base_dir + @options.op_dir
138
- index_file = out_dir + SEARCH_INDEX_FILE
139
+ out_dir = @base_dir + @options.op_dir
140
+ index_file = out_dir + SEARCH_INDEX_FILE
139
141
 
140
- FileUtils.mkdir_p index_file.dirname, :verbose => $DEBUG_RDOC
142
+ FileUtils.mkdir_p index_file.dirname, :verbose => $DEBUG_RDOC
141
143
 
142
- index_file.open 'w', 0644 do |io|
143
- io.set_encoding Encoding::UTF_8
144
- io.write 'var search_data = '
144
+ index_file.open 'w', 0644 do |io|
145
+ io.set_encoding ::Encoding::UTF_8
146
+ io.write 'var search_data = '
145
147
 
146
- JSON.dump data, io, 0
147
- end
148
- unless ENV['SOURCE_DATE_EPOCH'].nil?
149
- index_file.utime index_file.atime, Time.at(ENV['SOURCE_DATE_EPOCH'].to_i).gmtime
150
- end
148
+ JSON.dump data, io
149
+ end
150
+ unless ENV['SOURCE_DATE_EPOCH'].nil?
151
+ index_file.utime index_file.atime, Time.at(ENV['SOURCE_DATE_EPOCH'].to_i).gmtime
152
+ end
151
153
 
152
- Dir.chdir @template_dir do
153
- Dir['**/*.js'].each do |source|
154
- dest = File.join out_dir, source
154
+ Dir.chdir @template_dir do
155
+ Dir['**/*.js'].each do |source|
156
+ dest = File.join out_dir, source
155
157
 
156
- FileUtils.install source, dest, :mode => 0644, :preserve => true, :verbose => $DEBUG_RDOC
158
+ FileUtils.install source, dest, :mode => 0644, :preserve => true, :verbose => $DEBUG_RDOC
159
+ end
160
+ end
157
161
  end
158
- end
159
- end
160
162
 
161
- ##
162
- # Compress the search_index.js file using gzip
163
+ ##
164
+ # Compress the search_index.js file using gzip
163
165
 
164
- def generate_gzipped
165
- return if @options.dry_run or not defined?(Zlib)
166
+ def generate_gzipped
167
+ return if @options.dry_run or not defined?(Zlib)
166
168
 
167
- debug_msg "Compressing generated JSON index"
168
- out_dir = @base_dir + @options.op_dir
169
+ debug_msg "Compressing generated JSON index"
170
+ out_dir = @base_dir + @options.op_dir
169
171
 
170
- search_index_file = out_dir + SEARCH_INDEX_FILE
171
- outfile = out_dir + "#{search_index_file}.gz"
172
+ search_index_file = out_dir + SEARCH_INDEX_FILE
173
+ outfile = out_dir + "#{search_index_file}.gz"
172
174
 
173
- debug_msg "Reading the JSON index file from %s" % search_index_file
174
- search_index = search_index_file.read(mode: 'r:utf-8')
175
+ debug_msg "Reading the JSON index file from %s" % search_index_file
176
+ search_index = search_index_file.read(mode: 'r:utf-8')
175
177
 
176
- debug_msg "Writing gzipped search index to %s" % outfile
178
+ debug_msg "Writing gzipped search index to %s" % outfile
177
179
 
178
- Zlib::GzipWriter.open(outfile) do |gz|
179
- gz.mtime = File.mtime(search_index_file)
180
- gz.orig_name = search_index_file.basename.to_s
181
- gz.write search_index
182
- gz.close
183
- end
180
+ Zlib::GzipWriter.open(outfile) do |gz|
181
+ gz.mtime = File.mtime(search_index_file)
182
+ gz.orig_name = search_index_file.basename.to_s
183
+ gz.write search_index
184
+ gz.close
185
+ end
184
186
 
185
- # GZip the rest of the js files
186
- Dir.chdir @template_dir do
187
- Dir['**/*.js'].each do |source|
188
- dest = out_dir + source
189
- outfile = out_dir + "#{dest}.gz"
187
+ # GZip the rest of the js files
188
+ Dir.chdir @template_dir do
189
+ Dir['**/*.js'].each do |source|
190
+ dest = out_dir + source
191
+ outfile = out_dir + "#{dest}.gz"
190
192
 
191
- debug_msg "Reading the original js file from %s" % dest
192
- data = dest.read
193
+ debug_msg "Reading the original js file from %s" % dest
194
+ data = dest.read
193
195
 
194
- debug_msg "Writing gzipped file to %s" % outfile
196
+ debug_msg "Writing gzipped file to %s" % outfile
195
197
 
196
- Zlib::GzipWriter.open(outfile) do |gz|
197
- gz.mtime = File.mtime(dest)
198
- gz.orig_name = dest.basename.to_s
199
- gz.write data
200
- gz.close
198
+ Zlib::GzipWriter.open(outfile) do |gz|
199
+ gz.mtime = File.mtime(dest)
200
+ gz.orig_name = dest.basename.to_s
201
+ gz.write data
202
+ gz.close
203
+ end
204
+ end
201
205
  end
202
206
  end
203
- end
204
- end
205
207
 
206
- ##
207
- # Adds classes and modules to the index
208
+ ##
209
+ # Adds classes and modules to the index
208
210
 
209
- def index_classes
210
- debug_msg " generating class search index"
211
+ def index_classes
212
+ debug_msg " generating class search index"
211
213
 
212
- documented = @classes.uniq.select do |klass|
213
- klass.document_self_or_methods
214
- end
214
+ documented = @classes.uniq.select do |klass|
215
+ klass.document_self_or_methods
216
+ end
215
217
 
216
- documented.each do |klass|
217
- debug_msg " #{klass.full_name}"
218
- record = klass.search_record
219
- @index[:searchIndex] << search_string(record.shift)
220
- @index[:longSearchIndex] << search_string(record.shift)
221
- @index[:info] << record
222
- end
223
- end
218
+ documented.each do |klass|
219
+ debug_msg " #{klass.full_name}"
220
+ record = klass.search_record
221
+ @index[:searchIndex] << search_string(record.shift)
222
+ @index[:longSearchIndex] << search_string(record.shift)
223
+ @index[:info] << record
224
+ end
225
+ end
224
226
 
225
- ##
226
- # Adds methods to the index
227
+ ##
228
+ # Adds methods to the index
227
229
 
228
- def index_methods
229
- debug_msg " generating method search index"
230
+ def index_methods
231
+ debug_msg " generating method search index"
230
232
 
231
- list = @classes.uniq.flat_map do |klass|
232
- klass.method_list
233
- end.sort_by do |method|
234
- [method.name, method.parent.full_name]
235
- end
233
+ list = @classes.uniq.flat_map do |klass|
234
+ klass.method_list
235
+ end.sort_by do |method|
236
+ [method.name, method.parent.full_name]
237
+ end
236
238
 
237
- list.each do |method|
238
- debug_msg " #{method.full_name}"
239
- record = method.search_record
240
- @index[:searchIndex] << "#{search_string record.shift}()"
241
- @index[:longSearchIndex] << "#{search_string record.shift}()"
242
- @index[:info] << record
243
- end
244
- end
239
+ list.each do |method|
240
+ debug_msg " #{method.full_name}"
241
+ record = method.search_record
242
+ @index[:searchIndex] << "#{search_string record.shift}()"
243
+ @index[:longSearchIndex] << "#{search_string record.shift}()"
244
+ @index[:info] << record
245
+ end
246
+ end
245
247
 
246
- ##
247
- # Adds pages to the index
248
+ ##
249
+ # Adds pages to the index
248
250
 
249
- def index_pages
250
- debug_msg " generating pages search index"
251
+ def index_pages
252
+ debug_msg " generating pages search index"
251
253
 
252
- pages = @files.select do |file|
253
- file.text? && file.full_name != @options.main_page
254
- end
254
+ pages = @files.select do |file|
255
+ file.text? && file.full_name != @options.main_page
256
+ end
255
257
 
256
- pages.each do |page|
257
- debug_msg " #{page.page_name}"
258
- record = page.search_record
259
- @index[:searchIndex] << search_string(record.shift)
260
- @index[:longSearchIndex] << ''
261
- record.shift
262
- @index[:info] << record
263
- end
264
- end
258
+ pages.each do |page|
259
+ debug_msg " #{page.page_name}"
260
+ record = page.search_record
261
+ @index[:searchIndex] << search_string(record.shift)
262
+ @index[:longSearchIndex] << ''
263
+ record.shift
264
+ @index[:info] << record
265
+ end
266
+ end
265
267
 
266
- def reset(files, classes) # :nodoc:
267
- @files = files
268
- @classes = classes
268
+ def reset(files, classes) # :nodoc:
269
+ @files = files
270
+ @classes = classes
269
271
 
270
- @index = {
271
- :searchIndex => [],
272
- :longSearchIndex => [],
273
- :info => []
274
- }
275
- end
272
+ @index = {
273
+ :searchIndex => [],
274
+ :longSearchIndex => [],
275
+ :info => []
276
+ }
277
+ end
276
278
 
277
- ##
278
- # Removes whitespace and downcases +string+
279
+ ##
280
+ # Removes whitespace and downcases +string+
279
281
 
280
- def search_string(string)
281
- string.downcase.gsub(/\s/, '')
282
- end
282
+ def search_string(string)
283
+ string.downcase.gsub(/\s/, '')
284
+ end
283
285
 
286
+ end
287
+ end
284
288
  end