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
data/lib/rdoc/ri/store.rb CHANGED
@@ -1,6 +1,8 @@
1
1
  # frozen_string_literal: true
2
- module RDoc::RI
2
+ module RDoc
3
+ module RI
3
4
 
4
- Store = RDoc::Store # :nodoc:
5
+ Store = ::RDoc::Store # :nodoc:
5
6
 
7
+ end
6
8
  end
data/lib/rdoc/ri/task.rb CHANGED
@@ -6,66 +6,70 @@ end unless defined?(RDoc)
6
6
 
7
7
  require_relative '../task'
8
8
 
9
- ##
10
- # RDoc::RI::Task creates ri data in <code>./.rdoc</code> for your project.
11
- #
12
- # It contains the following tasks:
13
- #
14
- # [ri]
15
- # Build ri data
16
- #
17
- # [clobber_ri]
18
- # Delete ri data files. This target is automatically added to the main
19
- # clobber target.
20
- #
21
- # [reri]
22
- # Rebuild the ri data from scratch even if they are not out of date.
23
- #
24
- # Simple example:
25
- #
26
- # require 'rdoc/ri/task'
27
- #
28
- # RDoc::RI::Task.new do |ri|
29
- # ri.main = 'README.md'
30
- # ri.rdoc_files.include 'README.md', 'lib/**/*.rb'
31
- # end
32
- #
33
- # For further configuration details see RDoc::Task.
9
+ module RDoc
10
+ module RI
11
+ ##
12
+ # RDoc::RI::Task creates ri data in <code>./.rdoc</code> for your project.
13
+ #
14
+ # It contains the following tasks:
15
+ #
16
+ # [ri]
17
+ # Build ri data
18
+ #
19
+ # [clobber_ri]
20
+ # Delete ri data files. This target is automatically added to the main
21
+ # clobber target.
22
+ #
23
+ # [reri]
24
+ # Rebuild the ri data from scratch even if they are not out of date.
25
+ #
26
+ # Simple example:
27
+ #
28
+ # require 'rdoc/ri/task'
29
+ #
30
+ # RDoc::RI::Task.new do |ri|
31
+ # ri.main = 'README.md'
32
+ # ri.rdoc_files.include 'README.md', 'lib/**/*.rb'
33
+ # end
34
+ #
35
+ # For further configuration details see RDoc::Task.
34
36
 
35
- class RDoc::RI::Task < RDoc::Task
37
+ class Task < ::RDoc::Task
36
38
 
37
- DEFAULT_NAMES = { # :nodoc:
38
- :clobber_rdoc => :clobber_ri,
39
- :rdoc => :ri,
40
- :rerdoc => :reri,
41
- }
39
+ DEFAULT_NAMES = { # :nodoc:
40
+ :clobber_rdoc => :clobber_ri,
41
+ :rdoc => :ri,
42
+ :rerdoc => :reri,
43
+ }
42
44
 
43
- ##
44
- # Create an ri task with the given name. See RDoc::Task for documentation on
45
- # setting names.
45
+ ##
46
+ # Create an ri task with the given name. See RDoc::Task for documentation on
47
+ # setting names.
46
48
 
47
- def initialize(name = DEFAULT_NAMES) # :yield: self
48
- super
49
- end
49
+ def initialize(name = DEFAULT_NAMES) # :yield: self
50
+ super
51
+ end
50
52
 
51
- def clobber_task_description # :nodoc:
52
- "Remove RI data files"
53
- end
53
+ def clobber_task_description # :nodoc:
54
+ "Remove RI data files"
55
+ end
54
56
 
55
- ##
56
- # Sets default task values
57
+ ##
58
+ # Sets default task values
57
59
 
58
- def defaults
59
- super
60
+ def defaults
61
+ super
60
62
 
61
- @rdoc_dir = '.rdoc'
62
- end
63
+ @rdoc_dir = '.rdoc'
64
+ end
63
65
 
64
- def rdoc_task_description # :nodoc:
65
- 'Build RI data files'
66
- end
66
+ def rdoc_task_description # :nodoc:
67
+ 'Build RI data files'
68
+ end
67
69
 
68
- def rerdoc_task_description # :nodoc:
69
- 'Rebuild RI data files'
70
+ def rerdoc_task_description # :nodoc:
71
+ 'Rebuild RI data files'
72
+ end
73
+ end
70
74
  end
71
75
  end
data/lib/rdoc/ri.rb CHANGED
@@ -1,21 +1,23 @@
1
1
  # frozen_string_literal: true
2
2
  require_relative '../rdoc'
3
3
 
4
- ##
5
- # Namespace for the ri command line tool's implementation.
6
- #
7
- # See <tt>ri --help</tt> for details.
4
+ module RDoc
5
+ ##
6
+ # Namespace for the ri command line tool's implementation.
7
+ #
8
+ # See <tt>ri --help</tt> for details.
8
9
 
9
- module RDoc::RI
10
+ module RI
10
11
 
11
- ##
12
- # Base RI error class
12
+ ##
13
+ # Base RI error class
13
14
 
14
- class Error < RDoc::Error; end
15
+ class Error < ::RDoc::Error; end
15
16
 
16
- autoload :Driver, "#{__dir__}/ri/driver"
17
- autoload :Paths, "#{__dir__}/ri/paths"
18
- autoload :Servlet, "#{__dir__}/ri/servlet"
19
- autoload :Store, "#{__dir__}/ri/store"
17
+ autoload :Driver, "#{__dir__}/ri/driver"
18
+ autoload :Paths, "#{__dir__}/ri/paths"
19
+ autoload :Servlet, "#{__dir__}/ri/servlet"
20
+ autoload :Store, "#{__dir__}/ri/store"
20
21
 
22
+ end
21
23
  end
@@ -3,255 +3,257 @@ require 'rubygems/user_interaction'
3
3
  require 'fileutils'
4
4
  require_relative '../rdoc'
5
5
 
6
- # We define the following two similar name classes in this file:
7
- #
8
- # - RDoc::RubyGemsHook
9
- # - RDoc::RubygemsHook
10
- #
11
- # RDoc::RubyGemsHook is the main class that has real logic.
12
- #
13
- # RDoc::RubygemsHook is a class that is only for
14
- # compatibility. RDoc::RubygemsHook is used by RubyGems directly. We
15
- # can remove this when all maintained RubyGems remove
16
- # `rubygems/rdoc.rb`.
17
-
18
- class RDoc::RubyGemsHook
19
-
20
- include Gem::UserInteraction
21
- extend Gem::UserInteraction
22
-
23
- @rdoc_version = nil
24
- @specs = []
6
+ module RDoc
7
+ # We define the following two similar name classes in this file:
8
+ #
9
+ # - RDoc::RubyGemsHook
10
+ # - RDoc::RubygemsHook
11
+ #
12
+ # RDoc::RubyGemsHook is the main class that has real logic.
13
+ #
14
+ # RDoc::RubygemsHook is a class that is only for
15
+ # compatibility. RDoc::RubygemsHook is used by RubyGems directly. We
16
+ # can remove this when all maintained RubyGems remove
17
+ # `rubygems/rdoc.rb`.
25
18
 
26
- ##
27
- # Force installation of documentation?
19
+ class RubyGemsHook
28
20
 
29
- attr_accessor :force
21
+ include Gem::UserInteraction
22
+ extend Gem::UserInteraction
30
23
 
31
- ##
32
- # Generate rdoc?
24
+ @rdoc_version = nil
25
+ @specs = []
33
26
 
34
- attr_accessor :generate_rdoc
27
+ ##
28
+ # Force installation of documentation?
35
29
 
36
- ##
37
- # Generate ri data?
30
+ attr_accessor :force
38
31
 
39
- attr_accessor :generate_ri
32
+ ##
33
+ # Generate rdoc?
40
34
 
41
- class << self
35
+ attr_accessor :generate_rdoc
42
36
 
43
37
  ##
44
- # Loaded version of RDoc. Set by ::load_rdoc
45
-
46
- attr_reader :rdoc_version
38
+ # Generate ri data?
47
39
 
48
- end
40
+ attr_accessor :generate_ri
49
41
 
50
- ##
51
- # Post installs hook that generates documentation for each specification in
52
- # +specs+
42
+ class << self
53
43
 
54
- def self.generate(installer, specs)
55
- start = Time.now
56
- types = installer.document
44
+ ##
45
+ # Loaded version of RDoc. Set by ::load_rdoc
57
46
 
58
- generate_rdoc = types.include? 'rdoc'
59
- generate_ri = types.include? 'ri'
47
+ attr_reader :rdoc_version
60
48
 
61
- specs.each do |spec|
62
- new(spec, generate_rdoc, generate_ri).generate
63
49
  end
64
50
 
65
- return unless generate_rdoc or generate_ri
51
+ ##
52
+ # Post installs hook that generates documentation for each specification in
53
+ # +specs+
66
54
 
67
- duration = (Time.now - start).to_i
68
- names = specs.map(&:name).join ', '
55
+ def self.generate(installer, specs)
56
+ start = Time.now
57
+ types = installer.document
69
58
 
70
- say "Done installing documentation for #{names} after #{duration} seconds"
71
- end
59
+ generate_rdoc = types.include? 'rdoc'
60
+ generate_ri = types.include? 'ri'
72
61
 
73
- def self.remove(uninstaller)
74
- new(uninstaller.spec).remove
75
- end
62
+ specs.each do |spec|
63
+ new(spec, generate_rdoc, generate_ri).generate
64
+ end
76
65
 
77
- ##
78
- # Loads the RDoc generator
66
+ return unless generate_rdoc or generate_ri
79
67
 
80
- def self.load_rdoc
81
- return if @rdoc_version
68
+ duration = (Time.now - start).to_i
69
+ names = specs.map(&:name).join ', '
82
70
 
83
- require_relative 'rdoc'
71
+ say "Done installing documentation for #{names} after #{duration} seconds"
72
+ end
84
73
 
85
- @rdoc_version = Gem::Version.new ::RDoc::VERSION
86
- end
74
+ def self.remove(uninstaller)
75
+ new(uninstaller.spec).remove
76
+ end
87
77
 
88
- ##
89
- # Creates a new documentation generator for +spec+. RDoc and ri data
90
- # generation can be enabled or disabled through +generate_rdoc+ and
91
- # +generate_ri+ respectively.
92
- #
93
- # Only +generate_ri+ is enabled by default.
78
+ ##
79
+ # Loads the RDoc generator
94
80
 
95
- def initialize(spec, generate_rdoc = false, generate_ri = true)
96
- @doc_dir = spec.doc_dir
97
- @force = false
98
- @rdoc = nil
99
- @spec = spec
81
+ def self.load_rdoc
82
+ return if @rdoc_version
100
83
 
101
- @generate_rdoc = generate_rdoc
102
- @generate_ri = generate_ri
84
+ require_relative 'rdoc'
103
85
 
104
- @rdoc_dir = spec.doc_dir 'rdoc'
105
- @ri_dir = spec.doc_dir 'ri'
106
- end
86
+ @rdoc_version = Gem::Version.new VERSION
87
+ end
107
88
 
108
- ##
109
- # Removes legacy rdoc arguments from +args+
110
- #--
111
- # TODO move to RDoc::Options
89
+ ##
90
+ # Creates a new documentation generator for +spec+. RDoc and ri data
91
+ # generation can be enabled or disabled through +generate_rdoc+ and
92
+ # +generate_ri+ respectively.
93
+ #
94
+ # Only +generate_ri+ is enabled by default.
112
95
 
113
- def delete_legacy_args(args)
114
- args.delete '--inline-source'
115
- args.delete '--promiscuous'
116
- args.delete '-p'
117
- args.delete '--one-file'
118
- end
96
+ def initialize(spec, generate_rdoc = false, generate_ri = true)
97
+ @doc_dir = spec.doc_dir
98
+ @force = false
99
+ @rdoc = nil
100
+ @spec = spec
119
101
 
120
- ##
121
- # Generates documentation using the named +generator+ ("aliki" or "ri")
122
- # and following the given +options+.
123
- #
124
- # Documentation will be generated into +destination+
102
+ @generate_rdoc = generate_rdoc
103
+ @generate_ri = generate_ri
125
104
 
126
- def document(generator, options, destination)
127
- generator_name = generator
105
+ @rdoc_dir = spec.doc_dir 'rdoc'
106
+ @ri_dir = spec.doc_dir 'ri'
107
+ end
128
108
 
129
- options = options.dup
130
- options.exclude ||= [] # TODO maybe move to RDoc::Options#finish
131
- options.setup_generator generator
132
- options.op_dir = destination
133
- Dir.chdir @spec.full_gem_path do
134
- options.finish
109
+ ##
110
+ # Removes legacy rdoc arguments from +args+
111
+ #--
112
+ # TODO move to RDoc::Options
113
+
114
+ def delete_legacy_args(args)
115
+ args.delete '--inline-source'
116
+ args.delete '--promiscuous'
117
+ args.delete '-p'
118
+ args.delete '--one-file'
135
119
  end
136
120
 
137
- generator = options.generator.new @rdoc.store, options
121
+ ##
122
+ # Generates documentation using the named +generator+ ("aliki" or "ri")
123
+ # and following the given +options+.
124
+ #
125
+ # Documentation will be generated into +destination+
126
+
127
+ def document(generator, options, destination)
128
+ generator_name = generator
129
+
130
+ options = options.dup
131
+ options.exclude ||= [] # TODO maybe move to RDoc::Options#finish
132
+ options.setup_generator generator
133
+ options.op_dir = destination
134
+ Dir.chdir @spec.full_gem_path do
135
+ options.finish
136
+ end
137
+
138
+ generator = options.generator.new @rdoc.store, options
138
139
 
139
- @rdoc.options = options
140
- @rdoc.generator = generator
140
+ @rdoc.options = options
141
+ @rdoc.generator = generator
141
142
 
142
- say "Installing #{generator_name} documentation for #{@spec.full_name}"
143
+ say "Installing #{generator_name} documentation for #{@spec.full_name}"
143
144
 
144
- FileUtils.mkdir_p options.op_dir
145
+ FileUtils.mkdir_p options.op_dir
145
146
 
146
- Dir.chdir options.op_dir do
147
- begin
148
- @rdoc.class.current = @rdoc
149
- @rdoc.generator.generate
150
- ensure
151
- @rdoc.class.current = nil
147
+ Dir.chdir options.op_dir do
148
+ begin
149
+ @rdoc.class.current = @rdoc
150
+ @rdoc.generator.generate
151
+ ensure
152
+ @rdoc.class.current = nil
153
+ end
152
154
  end
153
155
  end
154
- end
155
156
 
156
- ##
157
- # Generates RDoc and ri data
157
+ ##
158
+ # Generates RDoc and ri data
158
159
 
159
- def generate
160
- return if @spec.default_gem?
161
- return unless @generate_ri or @generate_rdoc
160
+ def generate
161
+ return if @spec.default_gem?
162
+ return unless @generate_ri or @generate_rdoc
162
163
 
163
- setup
164
+ setup
164
165
 
165
- options = nil
166
+ options = nil
166
167
 
167
- args = @spec.rdoc_options
168
- args.concat @spec.source_paths
169
- args.concat @spec.extra_rdoc_files
168
+ args = @spec.rdoc_options
169
+ args.concat @spec.source_paths
170
+ args.concat @spec.extra_rdoc_files
170
171
 
171
- case config_args = Gem.configuration[:rdoc]
172
- when String then
173
- args = args.concat config_args.split(' ')
174
- when Array then
175
- args = args.concat config_args
176
- end
172
+ case config_args = Gem.configuration[:rdoc]
173
+ when String
174
+ args = args.concat config_args.split(' ')
175
+ when Array
176
+ args = args.concat config_args
177
+ end
177
178
 
178
- delete_legacy_args args
179
+ delete_legacy_args args
179
180
 
180
- Dir.chdir @spec.full_gem_path do
181
- options = ::RDoc::Options.new
182
- options.default_title = "#{@spec.full_name} Documentation"
183
- options.parse args
184
- options.quiet = !Gem.configuration.really_verbose
185
- end
181
+ Dir.chdir @spec.full_gem_path do
182
+ options = Options.new
183
+ options.default_title = "#{@spec.full_name} Documentation"
184
+ options.parse args
185
+ options.quiet = !Gem.configuration.really_verbose
186
+ end
186
187
 
187
- @rdoc = new_rdoc
188
+ @rdoc = new_rdoc
188
189
 
189
- say "Parsing documentation for #{@spec.full_name}"
190
+ say "Parsing documentation for #{@spec.full_name}"
190
191
 
191
- Dir.chdir @spec.full_gem_path do
192
- # RDoc::Options#finish must be called before parse_files.
193
- # RDoc::Options#finish is also called after ri/aliki generator setup.
194
- # We need to dup the options to avoid modifying it after finish is called.
195
- parse_options = options.dup
196
- parse_options.finish
197
- @rdoc.options = parse_options
198
- @rdoc.store = RDoc::Store.new(parse_options)
199
- @rdoc.parse_files parse_options.files
200
- end
192
+ Dir.chdir @spec.full_gem_path do
193
+ # RDoc::Options#finish must be called before parse_files.
194
+ # RDoc::Options#finish is also called after ri/aliki generator setup.
195
+ # We need to dup the options to avoid modifying it after finish is called.
196
+ parse_options = options.dup
197
+ parse_options.finish
198
+ @rdoc.options = parse_options
199
+ @rdoc.store = Store.new(parse_options)
200
+ @rdoc.parse_files parse_options.files
201
+ end
201
202
 
202
- document 'ri', options, @ri_dir if
203
- @generate_ri and (@force or not File.exist? @ri_dir)
203
+ document 'ri', options, @ri_dir if
204
+ @generate_ri and (@force or not File.exist? @ri_dir)
204
205
 
205
- document 'aliki', options, @rdoc_dir if
206
- @generate_rdoc and (@force or not File.exist? @rdoc_dir)
207
- end
206
+ document 'aliki', options, @rdoc_dir if
207
+ @generate_rdoc and (@force or not File.exist? @rdoc_dir)
208
+ end
208
209
 
209
- ##
210
- # #new_rdoc creates a new RDoc instance. This method is provided only to
211
- # make testing easier.
210
+ ##
211
+ # #new_rdoc creates a new RDoc instance. This method is provided only to
212
+ # make testing easier.
212
213
 
213
- def new_rdoc # :nodoc:
214
- ::RDoc::RDoc.new
215
- end
214
+ def new_rdoc # :nodoc:
215
+ RDoc.new
216
+ end
216
217
 
217
- ##
218
- # Is rdoc documentation installed?
218
+ ##
219
+ # Is rdoc documentation installed?
219
220
 
220
- def rdoc_installed?
221
- File.exist? @rdoc_dir
222
- end
221
+ def rdoc_installed?
222
+ File.exist? @rdoc_dir
223
+ end
223
224
 
224
- ##
225
- # Removes generated RDoc and ri data
225
+ ##
226
+ # Removes generated RDoc and ri data
226
227
 
227
- def remove
228
- base_dir = @spec.base_dir
228
+ def remove
229
+ base_dir = @spec.base_dir
229
230
 
230
- raise Gem::FilePermissionError, base_dir unless File.writable? base_dir
231
+ raise Gem::FilePermissionError, base_dir unless File.writable? base_dir
231
232
 
232
- FileUtils.rm_rf @rdoc_dir
233
- FileUtils.rm_rf @ri_dir
234
- end
233
+ FileUtils.rm_rf @rdoc_dir
234
+ FileUtils.rm_rf @ri_dir
235
+ end
235
236
 
236
- ##
237
- # Is ri data installed?
237
+ ##
238
+ # Is ri data installed?
238
239
 
239
- def ri_installed?
240
- File.exist? @ri_dir
241
- end
240
+ def ri_installed?
241
+ File.exist? @ri_dir
242
+ end
242
243
 
243
- ##
244
- # Prepares the spec for documentation generation
244
+ ##
245
+ # Prepares the spec for documentation generation
245
246
 
246
- def setup
247
- self.class.load_rdoc
247
+ def setup
248
+ self.class.load_rdoc
248
249
 
249
- raise Gem::FilePermissionError, @doc_dir if
250
- File.exist?(@doc_dir) and not File.writable?(@doc_dir)
250
+ raise Gem::FilePermissionError, @doc_dir if
251
+ File.exist?(@doc_dir) and not File.writable?(@doc_dir)
251
252
 
252
- FileUtils.mkdir_p @doc_dir unless File.exist? @doc_dir
253
- end
253
+ FileUtils.mkdir_p @doc_dir unless File.exist? @doc_dir
254
+ end
254
255
 
256
+ end
255
257
  end
256
258
 
257
259
  module RDoc