voloko-sdoc 0.1.7 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. data/LICENSE +21 -0
  2. data/VERSION.yml +4 -0
  3. data/lib/sdoc/generator/shtml.rb +1 -4
  4. data/lib/sdoc.rb +0 -1
  5. metadata +32 -101
  6. data/rdoc/History.txt +0 -254
  7. data/rdoc/Manifest.txt +0 -126
  8. data/rdoc/README.txt +0 -47
  9. data/rdoc/RI.txt +0 -58
  10. data/rdoc/Rakefile +0 -70
  11. data/rdoc/bin/rdoc +0 -35
  12. data/rdoc/bin/ri +0 -5
  13. data/rdoc/lib/rdoc/alias.rb +0 -54
  14. data/rdoc/lib/rdoc/anon_class.rb +0 -10
  15. data/rdoc/lib/rdoc/any_method.rb +0 -190
  16. data/rdoc/lib/rdoc/attr.rb +0 -79
  17. data/rdoc/lib/rdoc/cache.rb +0 -41
  18. data/rdoc/lib/rdoc/class_module.rb +0 -87
  19. data/rdoc/lib/rdoc/code_object.rb +0 -152
  20. data/rdoc/lib/rdoc/code_objects.rb +0 -23
  21. data/rdoc/lib/rdoc/constant.rb +0 -36
  22. data/rdoc/lib/rdoc/context.rb +0 -712
  23. data/rdoc/lib/rdoc/diagram.rb +0 -340
  24. data/rdoc/lib/rdoc/dot.rb +0 -249
  25. data/rdoc/lib/rdoc/generator/darkfish.rb +0 -455
  26. data/rdoc/lib/rdoc/generator/markup.rb +0 -194
  27. data/rdoc/lib/rdoc/generator/ri.rb +0 -230
  28. data/rdoc/lib/rdoc/generator/template/darkfish/classpage.rhtml +0 -281
  29. data/rdoc/lib/rdoc/generator/template/darkfish/filepage.rhtml +0 -112
  30. data/rdoc/lib/rdoc/generator/template/darkfish/images/brick.png +0 -0
  31. data/rdoc/lib/rdoc/generator/template/darkfish/images/brick_link.png +0 -0
  32. data/rdoc/lib/rdoc/generator/template/darkfish/images/bug.png +0 -0
  33. data/rdoc/lib/rdoc/generator/template/darkfish/images/bullet_black.png +0 -0
  34. data/rdoc/lib/rdoc/generator/template/darkfish/images/bullet_toggle_minus.png +0 -0
  35. data/rdoc/lib/rdoc/generator/template/darkfish/images/bullet_toggle_plus.png +0 -0
  36. data/rdoc/lib/rdoc/generator/template/darkfish/images/date.png +0 -0
  37. data/rdoc/lib/rdoc/generator/template/darkfish/images/find.png +0 -0
  38. data/rdoc/lib/rdoc/generator/template/darkfish/images/loadingAnimation.gif +0 -0
  39. data/rdoc/lib/rdoc/generator/template/darkfish/images/macFFBgHack.png +0 -0
  40. data/rdoc/lib/rdoc/generator/template/darkfish/images/package.png +0 -0
  41. data/rdoc/lib/rdoc/generator/template/darkfish/images/page_green.png +0 -0
  42. data/rdoc/lib/rdoc/generator/template/darkfish/images/page_white_text.png +0 -0
  43. data/rdoc/lib/rdoc/generator/template/darkfish/images/page_white_width.png +0 -0
  44. data/rdoc/lib/rdoc/generator/template/darkfish/images/plugin.png +0 -0
  45. data/rdoc/lib/rdoc/generator/template/darkfish/images/ruby.png +0 -0
  46. data/rdoc/lib/rdoc/generator/template/darkfish/images/tag_green.png +0 -0
  47. data/rdoc/lib/rdoc/generator/template/darkfish/images/wrench.png +0 -0
  48. data/rdoc/lib/rdoc/generator/template/darkfish/images/wrench_orange.png +0 -0
  49. data/rdoc/lib/rdoc/generator/template/darkfish/images/zoom.png +0 -0
  50. data/rdoc/lib/rdoc/generator/template/darkfish/index.rhtml +0 -64
  51. data/rdoc/lib/rdoc/generator/template/darkfish/js/darkfish.js +0 -116
  52. data/rdoc/lib/rdoc/generator/template/darkfish/js/jquery.js +0 -32
  53. data/rdoc/lib/rdoc/generator/template/darkfish/js/quicksearch.js +0 -114
  54. data/rdoc/lib/rdoc/generator/template/darkfish/js/thickbox-compressed.js +0 -10
  55. data/rdoc/lib/rdoc/generator/template/darkfish/rdoc.css +0 -696
  56. data/rdoc/lib/rdoc/generator.rb +0 -8
  57. data/rdoc/lib/rdoc/ghost_method.rb +0 -8
  58. data/rdoc/lib/rdoc/include.rb +0 -39
  59. data/rdoc/lib/rdoc/known_classes.rb +0 -68
  60. data/rdoc/lib/rdoc/markup/attribute_manager.rb +0 -311
  61. data/rdoc/lib/rdoc/markup/formatter.rb +0 -25
  62. data/rdoc/lib/rdoc/markup/fragments.rb +0 -377
  63. data/rdoc/lib/rdoc/markup/inline.rb +0 -126
  64. data/rdoc/lib/rdoc/markup/lines.rb +0 -156
  65. data/rdoc/lib/rdoc/markup/preprocess.rb +0 -80
  66. data/rdoc/lib/rdoc/markup/to_flow.rb +0 -211
  67. data/rdoc/lib/rdoc/markup/to_html.rb +0 -406
  68. data/rdoc/lib/rdoc/markup/to_html_crossref.rb +0 -140
  69. data/rdoc/lib/rdoc/markup/to_latex.rb +0 -328
  70. data/rdoc/lib/rdoc/markup/to_test.rb +0 -53
  71. data/rdoc/lib/rdoc/markup/to_texinfo.rb +0 -73
  72. data/rdoc/lib/rdoc/markup.rb +0 -378
  73. data/rdoc/lib/rdoc/meta_method.rb +0 -8
  74. data/rdoc/lib/rdoc/normal_class.rb +0 -18
  75. data/rdoc/lib/rdoc/normal_module.rb +0 -34
  76. data/rdoc/lib/rdoc/options.rb +0 -542
  77. data/rdoc/lib/rdoc/parser/c.rb +0 -678
  78. data/rdoc/lib/rdoc/parser/perl.rb +0 -165
  79. data/rdoc/lib/rdoc/parser/ruby.rb +0 -2904
  80. data/rdoc/lib/rdoc/parser/simple.rb +0 -39
  81. data/rdoc/lib/rdoc/parser.rb +0 -138
  82. data/rdoc/lib/rdoc/rdoc.rb +0 -375
  83. data/rdoc/lib/rdoc/require.rb +0 -32
  84. data/rdoc/lib/rdoc/ri/cache.rb +0 -187
  85. data/rdoc/lib/rdoc/ri/descriptions.rb +0 -156
  86. data/rdoc/lib/rdoc/ri/display.rb +0 -340
  87. data/rdoc/lib/rdoc/ri/driver.rb +0 -828
  88. data/rdoc/lib/rdoc/ri/formatter.rb +0 -654
  89. data/rdoc/lib/rdoc/ri/paths.rb +0 -93
  90. data/rdoc/lib/rdoc/ri/reader.rb +0 -106
  91. data/rdoc/lib/rdoc/ri/util.rb +0 -79
  92. data/rdoc/lib/rdoc/ri/writer.rb +0 -68
  93. data/rdoc/lib/rdoc/ri.rb +0 -8
  94. data/rdoc/lib/rdoc/single_class.rb +0 -8
  95. data/rdoc/lib/rdoc/stats.rb +0 -178
  96. data/rdoc/lib/rdoc/task.rb +0 -276
  97. data/rdoc/lib/rdoc/tokenstream.rb +0 -33
  98. data/rdoc/lib/rdoc/top_level.rb +0 -242
  99. data/rdoc/lib/rdoc.rb +0 -398
@@ -1,542 +0,0 @@
1
- require 'optparse'
2
-
3
- require 'rdoc/ri/paths'
4
-
5
- ##
6
- # RDoc::Options handles the parsing and storage of options
7
-
8
- class RDoc::Options
9
-
10
- ##
11
- # Character-set
12
-
13
- attr_reader :charset
14
-
15
- ##
16
- # Should diagrams be drawn?
17
-
18
- attr_accessor :diagram
19
-
20
- ##
21
- # Files matching this pattern will be excluded
22
-
23
- attr_accessor :exclude
24
-
25
- ##
26
- # Should we draw fileboxes in diagrams?
27
-
28
- attr_reader :fileboxes
29
-
30
- ##
31
- # The list of files to be processed
32
-
33
- attr_accessor :files
34
-
35
- ##
36
- # Scan newer sources than the flag file if true.
37
-
38
- attr_reader :force_update
39
-
40
- ##
41
- # Description of the output generator (set with the <tt>-fmt</tt> option)
42
-
43
- attr_accessor :generator
44
-
45
- ##
46
- # Formatter to mark up text with
47
-
48
- attr_accessor :formatter
49
-
50
- ##
51
- # Image format for diagrams
52
-
53
- attr_reader :image_format
54
-
55
- ##
56
- # Include line numbers in the source listings?
57
-
58
- attr_reader :include_line_numbers
59
-
60
- ##
61
- # Name of the file, class or module to display in the initial index page (if
62
- # not specified the first file we encounter is used)
63
-
64
- attr_accessor :main_page
65
-
66
- ##
67
- # Merge into classes of the same name when generating ri
68
-
69
- attr_reader :merge
70
-
71
- ##
72
- # The name of the output directory
73
-
74
- attr_accessor :op_dir
75
-
76
- ##
77
- # Is RDoc in pipe mode?
78
-
79
- attr_accessor :pipe
80
-
81
- ##
82
- # Array of directories to search for files to satisfy an :include:
83
-
84
- attr_reader :rdoc_include
85
-
86
- ##
87
- # Include private and protected methods in the output?
88
-
89
- attr_accessor :show_all
90
-
91
- ##
92
- # Include the '#' at the front of hyperlinked instance method names
93
-
94
- attr_reader :show_hash
95
-
96
- ##
97
- # The number of columns in a tab
98
-
99
- attr_reader :tab_width
100
-
101
- ##
102
- # Template to be used when generating output
103
-
104
- attr_reader :template
105
-
106
- ##
107
- # Number of threads to parse with
108
-
109
- attr_accessor :threads
110
-
111
- ##
112
- # Documentation title
113
-
114
- attr_reader :title
115
-
116
- ##
117
- # Verbosity, zero means quiet
118
-
119
- attr_accessor :verbosity
120
-
121
- ##
122
- # URL of web cvs frontend
123
-
124
- attr_reader :webcvs
125
-
126
- def initialize # :nodoc:
127
- require 'rdoc/rdoc'
128
- @op_dir = 'doc'
129
- @show_all = false
130
- @main_page = nil
131
- @merge = false
132
- @exclude = []
133
- @generators = RDoc::RDoc::GENERATORS
134
- @generator = RDoc::Generator::Darkfish
135
- @generator_name = nil
136
- @rdoc_include = []
137
- @title = nil
138
- @template = nil
139
- @threads = if RUBY_PLATFORM == 'java' then
140
- Java::java::lang::Runtime.getRuntime.availableProcessors * 2
141
- else
142
- 2
143
- end
144
- @diagram = false
145
- @fileboxes = false
146
- @show_hash = false
147
- @image_format = 'png'
148
- @tab_width = 8
149
- @include_line_numbers = false
150
- @force_update = true
151
- @verbosity = 1
152
- @pipe = false
153
-
154
- @webcvs = nil
155
-
156
- @charset = 'utf-8'
157
- end
158
-
159
- ##
160
- # Parse command line options.
161
-
162
- def parse(argv)
163
- opts = OptionParser.new do |opt|
164
- opt.program_name = File.basename $0
165
- opt.version = RDoc::VERSION
166
- opt.release = nil
167
- opt.summary_indent = ' ' * 4
168
- opt.banner = <<-EOF
169
- Usage: #{opt.program_name} [options] [names...]
170
-
171
- Files are parsed, and the information they contain collected, before any
172
- output is produced. This allows cross references between all files to be
173
- resolved. If a name is a directory, it is traversed. If no names are
174
- specified, all Ruby files in the current directory (and subdirectories) are
175
- processed.
176
-
177
- How RDoc generates output depends on the output formatter being used, and on
178
- the options you give.
179
-
180
- - Darkfish creates frameless HTML output by Michael Granger.
181
-
182
- - ri creates ri data files
183
- EOF
184
-
185
- opt.separator nil
186
- opt.separator "Parsing Options:"
187
- opt.separator nil
188
-
189
- opt.on("--all", "-a",
190
- "Include all methods (not just public) in",
191
- "the output.") do |value|
192
- @show_all = value
193
- end
194
-
195
- opt.separator nil
196
-
197
- opt.on("--exclude=PATTERN", "-x", Regexp,
198
- "Do not process files or directories",
199
- "matching PATTERN.") do |value|
200
- @exclude << value
201
- end
202
-
203
- opt.separator nil
204
-
205
- opt.on("--extension=NEW=OLD", "-E",
206
- "Treat files ending with .new as if they",
207
- "ended with .old. Using '-E cgi=rb' will",
208
- "cause xxx.cgi to be parsed as a Ruby file.") do |value|
209
- new, old = value.split(/=/, 2)
210
-
211
- unless new and old then
212
- raise OptionParser::InvalidArgument, "Invalid parameter to '-E'"
213
- end
214
-
215
- unless RDoc::ParserFactory.alias_extension old, new then
216
- raise OptionParser::InvalidArgument, "Unknown extension .#{old} to -E"
217
- end
218
- end
219
-
220
- opt.separator nil
221
-
222
- opt.on("--force-update", "-U",
223
- "Forces rdoc to scan all sources even if",
224
- "newer than the flag file.") do |value|
225
- @force_update = value
226
- end
227
-
228
- opt.separator nil
229
-
230
- opt.on("--pipe",
231
- "Convert RDoc on stdin to HTML") do
232
- @pipe = true
233
- end
234
-
235
- opt.separator nil
236
-
237
- opt.on("--threads=THREADS", Integer,
238
- "Number of threads to parse with.") do |threads|
239
- @threads = threads
240
- end
241
-
242
- opt.separator nil
243
- opt.separator "Generator Options:"
244
- opt.separator nil
245
-
246
- opt.on("--charset=CHARSET", "-c",
247
- "Specifies the output HTML character-set.") do |value|
248
- @charset = value
249
- end
250
-
251
- opt.separator nil
252
-
253
- generator_text = @generators.keys.map { |name| " #{name}" }.sort
254
-
255
- opt.on("--fmt=FORMAT", "--format=FORMAT", "-f", @generators.keys,
256
- "Set the output formatter. One of:", *generator_text) do |value|
257
- @generator_name = value.downcase
258
- setup_generator
259
- end
260
-
261
- opt.separator nil
262
-
263
- opt.on("--include=DIRECTORIES", "-i", Array,
264
- "Set (or add to) the list of directories to",
265
- "be searched when satisfying :include:",
266
- "requests. Can be used more than once.") do |value|
267
- @rdoc_include.concat value.map { |dir| dir.strip }
268
- end
269
-
270
- opt.separator nil
271
-
272
- opt.on("--line-numbers", "-N",
273
- "Include line numbers in the source code.") do |value|
274
- @include_line_numbers = value
275
- end
276
-
277
- opt.separator nil
278
-
279
- opt.on("--main=NAME", "-m",
280
- "NAME will be the initial page displayed.") do |value|
281
- @main_page = value
282
- end
283
-
284
- opt.separator nil
285
-
286
- opt.on("--output=DIR", "--op", "-o",
287
- "Set the output directory.") do |value|
288
- @op_dir = value
289
- end
290
-
291
- opt.separator nil
292
-
293
- opt.on("--show-hash", "-H",
294
- "A name of the form #name in a comment is a",
295
- "possible hyperlink to an instance method",
296
- "name. When displayed, the '#' is removed",
297
- "unless this option is specified.") do |value|
298
- @show_hash = value
299
- end
300
-
301
- opt.separator nil
302
-
303
- opt.on("--tab-width=WIDTH", "-w", OptionParser::DecimalInteger,
304
- "Set the width of tab characters.") do |value|
305
- @tab_width = value
306
- end
307
-
308
- opt.separator nil
309
-
310
- opt.on("--template=NAME", "-T",
311
- "Set the template used when generating",
312
- "output.") do |value|
313
- @template = value
314
- end
315
-
316
- opt.separator nil
317
-
318
- opt.on("--title=TITLE", "-t",
319
- "Set TITLE as the title for HTML output.") do |value|
320
- @title = value
321
- end
322
-
323
- opt.separator nil
324
-
325
- opt.on("--webcvs=URL", "-W",
326
- "Specify a URL for linking to a web frontend",
327
- "to CVS. If the URL contains a '\%s', the",
328
- "name of the current file will be",
329
- "substituted; if the URL doesn't contain a",
330
- "'\%s', the filename will be appended to it.") do |value|
331
- @webcvs = value
332
- end
333
-
334
- opt.separator nil
335
- opt.separator "Diagram Options:"
336
- opt.separator nil
337
-
338
- image_formats = %w[gif png jpg jpeg]
339
- opt.on("--image-format=FORMAT", "-I", image_formats,
340
- "Sets output image format for diagrams. Can",
341
- "be #{image_formats.join ', '}. If this option",
342
- "is omitted, png is used. Requires",
343
- "diagrams.") do |value|
344
- @image_format = value
345
- end
346
-
347
- opt.separator nil
348
-
349
- opt.on("--diagram", "-d",
350
- "Generate diagrams showing modules and",
351
- "classes. You need dot V1.8.6 or later to",
352
- "use the --diagram option correctly. Dot is",
353
- "available from http://graphviz.org") do |value|
354
- check_diagram
355
- @diagram = true
356
- end
357
-
358
- opt.separator nil
359
-
360
- opt.on("--fileboxes", "-F",
361
- "Classes are put in boxes which represents",
362
- "files, where these classes reside. Classes",
363
- "shared between more than one file are",
364
- "shown with list of files that are sharing",
365
- "them. Silently discarded if --diagram is",
366
- "not given.") do |value|
367
- @fileboxes = value
368
- end
369
-
370
- opt.separator nil
371
- opt.separator "ri Generator Options:"
372
- opt.separator nil
373
-
374
- opt.on("--ri", "-r",
375
- "Generate output for use by `ri`. The files",
376
- "are stored in the '.rdoc' directory under",
377
- "your home directory unless overridden by a",
378
- "subsequent --op parameter, so no special",
379
- "privileges are needed.") do |value|
380
- @generator_name = "ri"
381
- @op_dir = RDoc::RI::Paths::HOMEDIR
382
- setup_generator
383
- end
384
-
385
- opt.separator nil
386
-
387
- opt.on("--ri-site", "-R",
388
- "Generate output for use by `ri`. The files",
389
- "are stored in a site-wide directory,",
390
- "making them accessible to others, so",
391
- "special privileges are needed.") do |value|
392
- @generator_name = "ri"
393
- @op_dir = RDoc::RI::Paths::SITEDIR
394
- setup_generator
395
- end
396
-
397
- opt.separator nil
398
-
399
- opt.on("--merge", "-M",
400
- "When creating ri output, merge previously",
401
- "processed classes into previously",
402
- "documented classes of the same name.") do |value|
403
- @merge = value
404
- end
405
-
406
- opt.separator nil
407
- opt.separator "Generic Options:"
408
- opt.separator nil
409
-
410
- opt.on("--debug", "-D",
411
- "Displays lots on internal stuff.") do |value|
412
- $DEBUG_RDOC = value
413
- end
414
-
415
- opt.on("--quiet", "-q",
416
- "Don't show progress as we parse.") do |value|
417
- @verbosity = 0
418
- end
419
-
420
- opt.on("--verbose", "-v",
421
- "Display extra progress as we parse.") do |value|
422
- @verbosity = 2
423
- end
424
-
425
- opt.separator nil
426
- opt.separator 'Deprecated options - these warn when set'
427
- opt.separator nil
428
-
429
- opt.on("--inline-source", "-S") do |value|
430
- warn "--inline-source will be removed from RDoc on or after August 2009"
431
- end
432
-
433
- opt.on("--promiscuous", "-p") do |value|
434
- warn "--promiscuous will be removed from RDoc on or after August 2009"
435
- end
436
-
437
- opt.separator nil
438
- end
439
-
440
- argv.insert(0, *ENV['RDOCOPT'].split) if ENV['RDOCOPT']
441
-
442
- opts.parse! argv
443
-
444
- @files = argv.dup
445
-
446
- @rdoc_include << "." if @rdoc_include.empty?
447
-
448
- if @exclude.empty? then
449
- @exclude = nil
450
- else
451
- @exclude = Regexp.new(@exclude.join("|"))
452
- end
453
-
454
- check_files
455
-
456
- # If no template was specified, use the default template for the output
457
- # formatter
458
-
459
- @template ||= @generator_name
460
-
461
- rescue OptionParser::InvalidArgument, OptionParser::InvalidOption => e
462
- puts opts
463
- puts
464
- puts e
465
- exit 1
466
- end
467
-
468
- ##
469
- # Set the title, but only if not already set. This means that a title set
470
- # from the command line trumps one set in a source file
471
-
472
- def title=(string)
473
- @title ||= string
474
- end
475
-
476
- ##
477
- # Don't display progress as we process the files
478
-
479
- def quiet
480
- @verbosity.zero?
481
- end
482
-
483
- def quiet=(bool)
484
- @verbosity = bool ? 0 : 1
485
- end
486
-
487
- private
488
-
489
- ##
490
- # Set up an output generator for the format in @generator_name
491
-
492
- def setup_generator
493
- @generator = @generators[@generator_name]
494
-
495
- unless @generator then
496
- raise OptionParser::InvalidArgument, "Invalid output formatter"
497
- end
498
- end
499
-
500
- # Check that the right version of 'dot' is available. Unfortunately this
501
- # doesn't work correctly under Windows NT, so we'll bypass the test under
502
- # Windows.
503
-
504
- def check_diagram
505
- return if RUBY_PLATFORM =~ /mswin|cygwin|mingw|bccwin/
506
-
507
- ok = false
508
- ver = nil
509
-
510
- IO.popen "dot -V 2>&1" do |io|
511
- ver = io.read
512
- if ver =~ /dot.+version(?:\s+gviz)?\s+(\d+)\.(\d+)/ then
513
- ok = ($1.to_i > 1) || ($1.to_i == 1 && $2.to_i >= 8)
514
- end
515
- end
516
-
517
- unless ok then
518
- if ver =~ /^dot.+version/ then
519
- $stderr.puts "Warning: You may need dot V1.8.6 or later to use\n",
520
- "the --diagram option correctly. You have:\n\n ",
521
- ver,
522
- "\nDiagrams might have strange background colors.\n\n"
523
- else
524
- $stderr.puts "You need the 'dot' program to produce diagrams.",
525
- "(see http://www.research.att.com/sw/tools/graphviz/)\n\n"
526
- exit
527
- end
528
- end
529
- end
530
-
531
- ##
532
- # Check that the files on the command line exist
533
-
534
- def check_files
535
- @files.each do |f|
536
- stat = File.stat f rescue next
537
- raise RDoc::Error, "file '#{f}' not readable" unless stat.readable?
538
- end
539
- end
540
-
541
- end
542
-