rdoc 5.1.0 → 6.13.1

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 (179) hide show
  1. checksums.yaml +5 -5
  2. data/CONTRIBUTING.rdoc +5 -6
  3. data/ExampleMarkdown.md +2 -0
  4. data/ExampleRDoc.rdoc +2 -0
  5. data/History.rdoc +68 -66
  6. data/LEGAL.rdoc +1 -1
  7. data/LICENSE.rdoc +2 -0
  8. data/README.rdoc +18 -6
  9. data/RI.md +842 -0
  10. data/TODO.rdoc +8 -7
  11. data/exe/rdoc +0 -1
  12. data/lib/rdoc/{alias.rb → code_object/alias.rb} +4 -12
  13. data/lib/rdoc/{anon_class.rb → code_object/anon_class.rb} +1 -2
  14. data/lib/rdoc/{any_method.rb → code_object/any_method.rb} +83 -26
  15. data/lib/rdoc/{attr.rb → code_object/attr.rb} +5 -9
  16. data/lib/rdoc/{class_module.rb → code_object/class_module.rb} +112 -24
  17. data/lib/rdoc/{constant.rb → code_object/constant.rb} +4 -5
  18. data/lib/rdoc/{context → code_object/context}/section.rb +13 -83
  19. data/lib/rdoc/{context.rb → code_object/context.rb} +69 -70
  20. data/lib/rdoc/{extend.rb → code_object/extend.rb} +1 -2
  21. data/lib/rdoc/{ghost_method.rb → code_object/ghost_method.rb} +1 -2
  22. data/lib/rdoc/{include.rb → code_object/include.rb} +1 -2
  23. data/lib/rdoc/{meta_method.rb → code_object/meta_method.rb} +1 -2
  24. data/lib/rdoc/{method_attr.rb → code_object/method_attr.rb} +22 -31
  25. data/lib/rdoc/{mixin.rb → code_object/mixin.rb} +1 -2
  26. data/lib/rdoc/{normal_class.rb → code_object/normal_class.rb} +4 -5
  27. data/lib/rdoc/{normal_module.rb → code_object/normal_module.rb} +2 -3
  28. data/lib/rdoc/{require.rb → code_object/require.rb} +2 -3
  29. data/lib/rdoc/{single_class.rb → code_object/single_class.rb} +6 -2
  30. data/lib/rdoc/{top_level.rb → code_object/top_level.rb} +22 -32
  31. data/lib/rdoc/code_object.rb +8 -41
  32. data/lib/rdoc/code_objects.rb +2 -3
  33. data/lib/rdoc/comment.rb +48 -41
  34. data/lib/rdoc/cross_reference.rb +77 -33
  35. data/lib/rdoc/encoding.rb +50 -38
  36. data/lib/rdoc/erb_partial.rb +2 -3
  37. data/lib/rdoc/erbio.rb +4 -5
  38. data/lib/rdoc/generator/darkfish.rb +178 -125
  39. data/lib/rdoc/generator/json_index.rb +9 -22
  40. data/lib/rdoc/generator/markup.rb +6 -17
  41. data/lib/rdoc/generator/pot/message_extractor.rb +4 -4
  42. data/lib/rdoc/generator/pot/po.rb +3 -3
  43. data/lib/rdoc/generator/pot/po_entry.rb +12 -12
  44. data/lib/rdoc/generator/pot.rb +4 -8
  45. data/lib/rdoc/generator/ri.rb +1 -2
  46. data/lib/rdoc/generator/template/darkfish/_footer.rhtml +2 -2
  47. data/lib/rdoc/generator/template/darkfish/_head.rhtml +35 -12
  48. data/lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml +1 -5
  49. data/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml +7 -7
  50. data/lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml +7 -7
  51. data/lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml +6 -6
  52. data/lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml +19 -10
  53. data/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml +26 -6
  54. data/lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml +4 -9
  55. data/lib/rdoc/generator/template/darkfish/_sidebar_search.rhtml +1 -1
  56. data/lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml +4 -4
  57. data/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml +27 -6
  58. data/lib/rdoc/generator/template/darkfish/_sidebar_toggle.rhtml +3 -0
  59. data/lib/rdoc/generator/template/darkfish/class.rhtml +125 -78
  60. data/lib/rdoc/generator/template/darkfish/css/rdoc.css +430 -339
  61. data/lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Bold.ttf +0 -0
  62. data/lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Regular.ttf +0 -0
  63. data/lib/rdoc/generator/template/darkfish/index.rhtml +13 -13
  64. data/lib/rdoc/generator/template/darkfish/js/darkfish.js +51 -92
  65. data/lib/rdoc/generator/template/darkfish/js/search.js +35 -34
  66. data/lib/rdoc/generator/template/darkfish/page.rhtml +5 -5
  67. data/lib/rdoc/generator/template/darkfish/servlet_not_found.rhtml +10 -8
  68. data/lib/rdoc/generator/template/darkfish/servlet_root.rhtml +20 -18
  69. data/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml +32 -20
  70. data/lib/rdoc/generator/template/json_index/js/navigation.js +12 -49
  71. data/lib/rdoc/generator/template/json_index/js/searcher.js +6 -6
  72. data/lib/rdoc/generator.rb +6 -6
  73. data/lib/rdoc/i18n/locale.rb +1 -1
  74. data/lib/rdoc/i18n/text.rb +5 -5
  75. data/lib/rdoc/i18n.rb +4 -4
  76. data/lib/rdoc/known_classes.rb +6 -5
  77. data/lib/rdoc/markdown/entities.rb +1 -2
  78. data/lib/rdoc/markdown/literals.kpeg +1 -2
  79. data/lib/rdoc/markdown/literals.rb +99 -50
  80. data/lib/rdoc/markdown.kpeg +115 -58
  81. data/lib/rdoc/markdown.rb +1584 -902
  82. data/lib/rdoc/markup/attr_changer.rb +1 -2
  83. data/lib/rdoc/markup/attr_span.rb +9 -4
  84. data/lib/rdoc/markup/attribute_manager.rb +118 -57
  85. data/lib/rdoc/markup/attributes.rb +7 -8
  86. data/lib/rdoc/markup/blank_line.rb +1 -2
  87. data/lib/rdoc/markup/block_quote.rb +1 -2
  88. data/lib/rdoc/markup/document.rb +1 -2
  89. data/lib/rdoc/markup/formatter.rb +44 -37
  90. data/lib/rdoc/markup/hard_break.rb +1 -2
  91. data/lib/rdoc/markup/heading.rb +11 -6
  92. data/lib/rdoc/markup/include.rb +1 -2
  93. data/lib/rdoc/markup/indented_paragraph.rb +1 -2
  94. data/lib/rdoc/markup/list.rb +1 -2
  95. data/lib/rdoc/markup/list_item.rb +1 -2
  96. data/lib/rdoc/markup/paragraph.rb +1 -2
  97. data/lib/rdoc/markup/parser.rb +90 -48
  98. data/lib/rdoc/markup/pre_process.rb +38 -11
  99. data/lib/rdoc/markup/raw.rb +1 -2
  100. data/lib/rdoc/markup/regexp_handling.rb +40 -0
  101. data/lib/rdoc/markup/rule.rb +1 -2
  102. data/lib/rdoc/markup/table.rb +56 -0
  103. data/lib/rdoc/markup/to_ansi.rb +1 -2
  104. data/lib/rdoc/markup/to_bs.rb +30 -5
  105. data/lib/rdoc/markup/to_html.rb +95 -40
  106. data/lib/rdoc/markup/to_html_crossref.rb +108 -43
  107. data/lib/rdoc/markup/to_html_snippet.rb +13 -11
  108. data/lib/rdoc/markup/to_joined_paragraph.rb +6 -32
  109. data/lib/rdoc/markup/to_label.rb +11 -12
  110. data/lib/rdoc/markup/to_markdown.rb +13 -14
  111. data/lib/rdoc/markup/to_rdoc.rb +49 -31
  112. data/lib/rdoc/markup/to_table_of_contents.rb +2 -2
  113. data/lib/rdoc/markup/to_test.rb +1 -2
  114. data/lib/rdoc/markup/to_tt_only.rb +3 -4
  115. data/lib/rdoc/markup/verbatim.rb +1 -2
  116. data/lib/rdoc/markup.rb +64 -694
  117. data/lib/rdoc/options.rb +226 -44
  118. data/lib/rdoc/parser/c.rb +231 -246
  119. data/lib/rdoc/parser/changelog.rb +169 -23
  120. data/lib/rdoc/parser/markdown.rb +1 -3
  121. data/lib/rdoc/parser/prism_ruby.rb +1092 -0
  122. data/lib/rdoc/parser/rd.rb +1 -2
  123. data/lib/rdoc/parser/ripper_state_lex.rb +302 -0
  124. data/lib/rdoc/parser/ruby.rb +695 -478
  125. data/lib/rdoc/parser/ruby_tools.rb +33 -36
  126. data/lib/rdoc/parser/simple.rb +4 -4
  127. data/lib/rdoc/parser/text.rb +1 -2
  128. data/lib/rdoc/parser.rb +37 -42
  129. data/lib/rdoc/rd/block_parser.rb +708 -57
  130. data/lib/rdoc/rd/block_parser.ry +15 -11
  131. data/lib/rdoc/rd/inline.rb +5 -6
  132. data/lib/rdoc/rd/inline_parser.rb +787 -140
  133. data/lib/rdoc/rd/inline_parser.ry +1 -1
  134. data/lib/rdoc/rd.rb +4 -5
  135. data/lib/rdoc/rdoc.rb +72 -87
  136. data/lib/rdoc/ri/driver.rb +236 -152
  137. data/lib/rdoc/ri/formatter.rb +1 -1
  138. data/lib/rdoc/ri/paths.rb +4 -18
  139. data/lib/rdoc/ri/store.rb +1 -2
  140. data/lib/rdoc/ri/task.rb +2 -2
  141. data/lib/rdoc/ri.rb +5 -6
  142. data/lib/rdoc/rubygems_hook.rb +98 -20
  143. data/lib/rdoc/servlet.rb +30 -20
  144. data/lib/rdoc/stats/normal.rb +24 -18
  145. data/lib/rdoc/stats/quiet.rb +1 -2
  146. data/lib/rdoc/stats/verbose.rb +1 -3
  147. data/lib/rdoc/stats.rb +6 -7
  148. data/lib/rdoc/store.rb +84 -55
  149. data/lib/rdoc/task.rb +35 -10
  150. data/lib/rdoc/text.rb +40 -27
  151. data/lib/rdoc/token_stream.rb +56 -34
  152. data/lib/rdoc/tom_doc.rb +18 -19
  153. data/lib/rdoc/version.rb +10 -0
  154. data/lib/rdoc.rb +80 -56
  155. data/lib/rubygems_plugin.rb +23 -0
  156. data/man/ri.1 +247 -0
  157. metadata +45 -99
  158. data/.document +0 -5
  159. data/.gitignore +0 -13
  160. data/.travis.yml +0 -24
  161. data/Gemfile +0 -3
  162. data/RI.rdoc +0 -57
  163. data/Rakefile +0 -133
  164. data/bin/console +0 -7
  165. data/bin/setup +0 -6
  166. data/lib/gauntlet_rdoc.rb +0 -82
  167. data/lib/rdoc/generator/template/darkfish/.document +0 -0
  168. data/lib/rdoc/generator/template/darkfish/_sidebar_VCS_info.rhtml +0 -19
  169. data/lib/rdoc/generator/template/darkfish/_sidebar_in_files.rhtml +0 -9
  170. data/lib/rdoc/generator/template/darkfish/js/jquery.js +0 -4
  171. data/lib/rdoc/generator/template/json_index/.document +0 -1
  172. data/lib/rdoc/markup/formatter_test_case.rb +0 -764
  173. data/lib/rdoc/markup/inline.rb +0 -2
  174. data/lib/rdoc/markup/special.rb +0 -41
  175. data/lib/rdoc/markup/text_formatter_test_case.rb +0 -115
  176. data/lib/rdoc/ruby_lex.rb +0 -1367
  177. data/lib/rdoc/ruby_token.rb +0 -461
  178. data/lib/rdoc/test_case.rb +0 -204
  179. data/rdoc.gemspec +0 -57
@@ -436,7 +436,7 @@ end
436
436
  def parse inline
437
437
  @inline = inline
438
438
  @src = StringScanner.new inline
439
- @pre = ""
439
+ @pre = "".dup
440
440
  @yydebug = true
441
441
  do_parse.to_s
442
442
  end
data/lib/rdoc/rd.rb CHANGED
@@ -1,4 +1,4 @@
1
- # frozen_string_literal: false
1
+ # frozen_string_literal: true
2
2
  ##
3
3
  # RDoc::RD implements the RD format from the rdtool gem.
4
4
  #
@@ -92,9 +92,8 @@ class RDoc::RD
92
92
  document
93
93
  end
94
94
 
95
- autoload :BlockParser, 'rdoc/rd/block_parser'
96
- autoload :InlineParser, 'rdoc/rd/inline_parser'
97
- autoload :Inline, 'rdoc/rd/inline'
95
+ autoload :BlockParser, "#{__dir__}/rd/block_parser"
96
+ autoload :InlineParser, "#{__dir__}/rd/inline_parser"
97
+ autoload :Inline, "#{__dir__}/rd/inline"
98
98
 
99
99
  end
100
-
data/lib/rdoc/rdoc.rb CHANGED
@@ -1,5 +1,5 @@
1
- # frozen_string_literal: false
2
- require 'rdoc'
1
+ # frozen_string_literal: true
2
+ require_relative '../rdoc'
3
3
 
4
4
  require 'find'
5
5
  require 'fileutils'
@@ -14,7 +14,7 @@ require 'time'
14
14
  # is:
15
15
  #
16
16
  # rdoc = RDoc::RDoc.new
17
- # options = rdoc.load_options # returns an RDoc::Options instance
17
+ # options = RDoc::Options.load_options # returns an RDoc::Options instance
18
18
  # # set extra options
19
19
  # rdoc.document options
20
20
  #
@@ -24,7 +24,7 @@ require 'time'
24
24
  # rdoc.document argv
25
25
  #
26
26
  # Where +argv+ is an array of strings, each corresponding to an argument you'd
27
- # give rdoc on the command line. See <tt>rdoc --help<tt> for details.
27
+ # give rdoc on the command line. See <tt>rdoc --help</tt> for details.
28
28
 
29
29
  class RDoc::RDoc
30
30
 
@@ -36,9 +36,15 @@ class RDoc::RDoc
36
36
  GENERATORS = {}
37
37
 
38
38
  ##
39
- # File pattern to exclude
39
+ # List of directory names always skipped
40
+
41
+ UNCONDITIONALLY_SKIPPED_DIRECTORIES = %w[CVS .svn .git].freeze
42
+
43
+ ##
44
+ # List of directory names skipped if test suites should be skipped
45
+
46
+ TEST_SUITE_DIRECTORY_NAMES = %w[spec test].freeze
40
47
 
41
- attr_accessor :exclude
42
48
 
43
49
  ##
44
50
  # Generator instance used for creating output
@@ -63,7 +69,7 @@ class RDoc::RDoc
63
69
  ##
64
70
  # The current documentation store
65
71
 
66
- attr_reader :store
72
+ attr_accessor :store
67
73
 
68
74
  ##
69
75
  # Add +klass+ that can generate output after parsing
@@ -93,7 +99,6 @@ class RDoc::RDoc
93
99
 
94
100
  def initialize
95
101
  @current = nil
96
- @exclude = nil
97
102
  @generator = nil
98
103
  @last_modified = {}
99
104
  @old_siginfo = nil
@@ -114,15 +119,21 @@ class RDoc::RDoc
114
119
  # +files+.
115
120
 
116
121
  def gather_files files
117
- files = ["."] if files.empty?
118
-
119
- file_list = normalized_file_list files, true, @exclude
122
+ files = [@options.root.to_s] if files.empty?
120
123
 
121
- file_list = file_list.uniq
124
+ file_list = normalized_file_list files, true, @options.exclude
122
125
 
123
- file_list = remove_unparseable file_list
126
+ file_list = remove_unparseable(file_list)
124
127
 
125
- file_list.sort
128
+ if file_list.count {|name, mtime|
129
+ file_list[name] = @last_modified[name] unless mtime
130
+ mtime
131
+ } > 0
132
+ @last_modified.replace file_list
133
+ file_list.keys.sort
134
+ else
135
+ []
136
+ end
126
137
  end
127
138
 
128
139
  ##
@@ -151,27 +162,6 @@ class RDoc::RDoc
151
162
  end
152
163
  end
153
164
 
154
- ##
155
- # Loads options from .rdoc_options if the file exists, otherwise creates a
156
- # new RDoc::Options instance.
157
-
158
- def load_options
159
- options_file = File.expand_path '.rdoc_options'
160
- return RDoc::Options.new unless File.exist? options_file
161
-
162
- RDoc.load_yaml
163
-
164
- begin
165
- options = YAML.load_file '.rdoc_options'
166
- rescue Psych::SyntaxError
167
- end
168
-
169
- raise RDoc::Error, "#{options_file} is not a valid rdoc options file" unless
170
- RDoc::Options === options
171
-
172
- options
173
- end
174
-
175
165
  ##
176
166
  # Create an output dir if it doesn't exist. If it does exist, but doesn't
177
167
  # contain the flag file <tt>created.rid</tt> then we refuse to use it, as
@@ -188,7 +178,7 @@ class RDoc::RDoc
188
178
  error "#{dir} exists and is not a directory" unless File.directory? dir
189
179
 
190
180
  begin
191
- open flag_file do |io|
181
+ File.open flag_file do |io|
192
182
  unless force then
193
183
  Time.parse io.gets
194
184
 
@@ -218,22 +208,16 @@ option)
218
208
  last
219
209
  end
220
210
 
221
- ##
222
- # Sets the current documentation tree to +store+ and sets the store's rdoc
223
- # driver to this instance.
224
-
225
- def store= store
226
- @store = store
227
- @store.rdoc = self
228
- end
229
-
230
211
  ##
231
212
  # Update the flag file in an output directory.
232
213
 
233
214
  def update_output_dir(op_dir, time, last = {})
234
215
  return if @options.dry_run or not @options.update_output_dir
216
+ unless ENV['SOURCE_DATE_EPOCH'].nil?
217
+ time = Time.at(ENV['SOURCE_DATE_EPOCH'].to_i).gmtime
218
+ end
235
219
 
236
- open output_flag_file(op_dir), "w" do |f|
220
+ File.open output_flag_file(op_dir), "w" do |f|
237
221
  f.puts time.rfc2822
238
222
  last.each do |n, t|
239
223
  f.puts "#{n}\t#{t.rfc2822}"
@@ -257,11 +241,11 @@ option)
257
241
  # read and strip comments
258
242
  patterns = File.read(filename).gsub(/#.*/, '')
259
243
 
260
- result = []
244
+ result = {}
261
245
 
262
- patterns.split.each do |patt|
246
+ patterns.split(' ').each do |patt|
263
247
  candidates = Dir.glob(File.join(in_dir, patt))
264
- result.concat normalized_file_list(candidates)
248
+ result.update normalized_file_list(candidates, false, @options.exclude)
265
249
  end
266
250
 
267
251
  result
@@ -281,24 +265,27 @@ option)
281
265
 
282
266
  def normalized_file_list(relative_files, force_doc = false,
283
267
  exclude_pattern = nil)
284
- file_list = []
268
+ file_list = {}
285
269
 
286
270
  relative_files.each do |rel_file_name|
271
+ rel_file_name = rel_file_name.sub(/^\.\//, '')
287
272
  next if rel_file_name.end_with? 'created.rid'
288
273
  next if exclude_pattern && exclude_pattern =~ rel_file_name
289
274
  stat = File.stat rel_file_name rescue next
290
275
 
291
276
  case type = stat.ftype
292
277
  when "file" then
293
- next if last_modified = @last_modified[rel_file_name] and
294
- stat.mtime.to_i <= last_modified.to_i
278
+ mtime = (stat.mtime unless (last_modified = @last_modified[rel_file_name] and
279
+ stat.mtime.to_i <= last_modified.to_i))
295
280
 
296
281
  if force_doc or RDoc::Parser.can_parse(rel_file_name) then
297
- file_list << rel_file_name.sub(/^\.\//, '')
298
- @last_modified[rel_file_name] = stat.mtime
282
+ file_list[rel_file_name] = mtime
299
283
  end
300
284
  when "directory" then
301
- next if rel_file_name == "CVS" || rel_file_name == ".svn"
285
+ next if UNCONDITIONALLY_SKIPPED_DIRECTORIES.include?(rel_file_name)
286
+
287
+ basename = File.basename(rel_file_name)
288
+ next if options.skip_tests && TEST_SUITE_DIRECTORY_NAMES.include?(basename)
302
289
 
303
290
  created_rid = File.join rel_file_name, "created.rid"
304
291
  next if File.file? created_rid
@@ -306,16 +293,16 @@ option)
306
293
  dot_doc = File.join rel_file_name, RDoc::DOT_DOC_FILENAME
307
294
 
308
295
  if File.file? dot_doc then
309
- file_list << parse_dot_doc_file(rel_file_name, dot_doc)
296
+ file_list.update(parse_dot_doc_file(rel_file_name, dot_doc))
310
297
  else
311
- file_list << list_files_in_directory(rel_file_name)
298
+ file_list.update(list_files_in_directory(rel_file_name))
312
299
  end
313
300
  else
314
301
  warn "rdoc can't parse the #{type} #{rel_file_name}"
315
302
  end
316
303
  end
317
304
 
318
- file_list.flatten
305
+ file_list
319
306
  end
320
307
 
321
308
  ##
@@ -358,9 +345,9 @@ option)
358
345
  relative_path.relative_path_from @options.page_dir
359
346
  end
360
347
 
361
- top_level = @store.add_file filename, relative_path.to_s
348
+ top_level = @store.add_file filename, relative_name: relative_path.to_s
362
349
 
363
- parser = RDoc::Parser.for top_level, filename, content, @options, @stats
350
+ parser = RDoc::Parser.for top_level, content, @options, @stats
364
351
 
365
352
  return unless parser
366
353
 
@@ -399,7 +386,6 @@ The internal error was:
399
386
  $stderr.puts e.backtrace.join("\n\t") if $DEBUG_RDOC
400
387
 
401
388
  raise e
402
- nil
403
389
  end
404
390
 
405
391
  ##
@@ -411,6 +397,7 @@ The internal error was:
411
397
 
412
398
  return [] if file_list.empty?
413
399
 
400
+ # This workaround can be removed after the :main: directive is removed
414
401
  original_options = @options.dup
415
402
  @stats.begin_adding
416
403
 
@@ -419,6 +406,8 @@ The internal error was:
419
406
  parse_file filename
420
407
  end.compact
421
408
 
409
+ @store.resolve_c_superclasses
410
+
422
411
  @stats.done_adding
423
412
  @options = original_options
424
413
 
@@ -430,12 +419,10 @@ The internal error was:
430
419
  # files for emacs and vim.
431
420
 
432
421
  def remove_unparseable files
433
- files.reject do |file|
422
+ files.reject do |file, *|
434
423
  file =~ /\.(?:class|eps|erb|scpt\.txt|svg|ttf|yml)$/i or
435
424
  (file =~ /tags$/i and
436
- open(file, 'rb') { |io|
437
- io.read(100) =~ /\A(\f\n[^,]+,\d+$|!_TAG_)/
438
- })
425
+ /\A(\f\n[^,]+,\d+$|!_TAG_)/.match?(File.binread(file, 100)))
439
426
  end
440
427
  end
441
428
 
@@ -454,33 +441,25 @@ The internal error was:
454
441
  # current directory, so make sure you're somewhere writable before invoking.
455
442
 
456
443
  def document options
457
- self.store = RDoc::Store.new
458
-
459
444
  if RDoc::Options === options then
460
445
  @options = options
461
- @options.finish
462
446
  else
463
- @options = load_options
447
+ @options = RDoc::Options.load_options
464
448
  @options.parse options
465
449
  end
450
+ @options.finish
451
+
452
+ @store = RDoc::Store.new(@options)
466
453
 
467
454
  if @options.pipe then
468
455
  handle_pipe
469
456
  exit
470
457
  end
471
458
 
472
- @exclude = @options.exclude
473
-
474
459
  unless @options.coverage_report then
475
460
  @last_modified = setup_output_dir @options.op_dir, @options.force_update
476
461
  end
477
462
 
478
- @store.encoding = @options.encoding
479
- @store.dry_run = @options.dry_run
480
- @store.main = @options.main_page
481
- @store.title = @options.title
482
- @store.path = @options.op_dir
483
-
484
463
  @start_time = Time.now
485
464
 
486
465
  @store.load_cache
@@ -521,13 +500,19 @@ The internal error was:
521
500
  # by the RDoc options
522
501
 
523
502
  def generate
524
- Dir.chdir @options.op_dir do
525
- unless @options.quiet then
526
- $stderr.puts "\nGenerating #{@generator.class.name.sub(/^.*::/, '')} format into #{Dir.pwd}..."
527
- end
528
-
503
+ if @options.dry_run then
504
+ # do nothing
529
505
  @generator.generate
530
- update_output_dir '.', @start_time, @last_modified
506
+ else
507
+ Dir.chdir @options.op_dir do
508
+ unless @options.quiet then
509
+ $stderr.puts "\nGenerating #{@generator.class.name.sub(/^.*::/, '')} format into #{Dir.pwd}..."
510
+ $stderr.puts "\nYou can visit the home page at: \e]8;;file://#{Dir.pwd}/index.html\e\\file://#{Dir.pwd}/index.html\e]8;;\e\\"
511
+ end
512
+
513
+ @generator.generate
514
+ update_output_dir '.', @start_time, @last_modified
515
+ end
531
516
  end
532
517
  end
533
518
 
@@ -547,7 +532,7 @@ end
547
532
  begin
548
533
  require 'rubygems'
549
534
 
550
- rdoc_extensions = Gem.find_files 'rdoc/discover'
535
+ rdoc_extensions = Gem.find_latest_files 'rdoc/discover'
551
536
 
552
537
  rdoc_extensions.each do |extension|
553
538
  begin
@@ -561,6 +546,6 @@ rescue LoadError
561
546
  end
562
547
 
563
548
  # require built-in generators after discovery in case they've been replaced
564
- require 'rdoc/generator/darkfish'
565
- require 'rdoc/generator/ri'
566
- require 'rdoc/generator/pot'
549
+ require_relative 'generator/darkfish'
550
+ require_relative 'generator/ri'
551
+ require_relative 'generator/pot'