rdoc 6.8.1 → 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 (57) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rdoc/code_object/alias.rb +2 -9
  3. data/lib/rdoc/code_object/any_method.rb +7 -12
  4. data/lib/rdoc/code_object/attr.rb +4 -7
  5. data/lib/rdoc/code_object/class_module.rb +53 -20
  6. data/lib/rdoc/code_object/constant.rb +1 -1
  7. data/lib/rdoc/code_object/context/section.rb +10 -68
  8. data/lib/rdoc/code_object/context.rb +4 -46
  9. data/lib/rdoc/code_object/method_attr.rb +16 -24
  10. data/lib/rdoc/code_object/require.rb +1 -1
  11. data/lib/rdoc/code_object/top_level.rb +6 -24
  12. data/lib/rdoc/code_object.rb +3 -35
  13. data/lib/rdoc/comment.rb +12 -5
  14. data/lib/rdoc/generator/darkfish.rb +92 -108
  15. data/lib/rdoc/generator/json_index.rb +1 -17
  16. data/lib/rdoc/generator/markup.rb +2 -2
  17. data/lib/rdoc/generator/pot/message_extractor.rb +2 -2
  18. data/lib/rdoc/generator/pot.rb +0 -5
  19. data/lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml +1 -29
  20. data/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml +1 -1
  21. data/lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml +1 -1
  22. data/lib/rdoc/generator/template/darkfish/class.rhtml +15 -0
  23. data/lib/rdoc/generator/template/darkfish/css/rdoc.css +40 -21
  24. data/lib/rdoc/generator/template/darkfish/index.rhtml +4 -4
  25. data/lib/rdoc/generator/template/darkfish/js/darkfish.js +7 -1
  26. data/lib/rdoc/markdown.kpeg +7 -5
  27. data/lib/rdoc/markdown.rb +34 -21
  28. data/lib/rdoc/markup/formatter.rb +19 -12
  29. data/lib/rdoc/markup/heading.rb +7 -1
  30. data/lib/rdoc/markup/pre_process.rb +17 -0
  31. data/lib/rdoc/markup/to_html.rb +7 -2
  32. data/lib/rdoc/markup/to_html_crossref.rb +63 -12
  33. data/lib/rdoc/markup/to_rdoc.rb +1 -1
  34. data/lib/rdoc/options.rb +68 -7
  35. data/lib/rdoc/parser/c.rb +29 -8
  36. data/lib/rdoc/parser/changelog.rb +3 -2
  37. data/lib/rdoc/parser/prism_ruby.rb +1092 -0
  38. data/lib/rdoc/parser/ruby.rb +8 -11
  39. data/lib/rdoc/parser/simple.rb +1 -1
  40. data/lib/rdoc/parser.rb +3 -3
  41. data/lib/rdoc/rd/block_parser.rb +3 -3
  42. data/lib/rdoc/rd/inline_parser.rb +3 -3
  43. data/lib/rdoc/rdoc.rb +6 -19
  44. data/lib/rdoc/ri/driver.rb +75 -26
  45. data/lib/rdoc/rubygems_hook.rb +91 -15
  46. data/lib/rdoc/servlet.rb +8 -7
  47. data/lib/rdoc/stats.rb +2 -2
  48. data/lib/rdoc/store.rb +21 -13
  49. data/lib/rdoc/text.rb +2 -2
  50. data/lib/rdoc/version.rb +1 -1
  51. data/lib/rdoc.rb +0 -2
  52. data/lib/rubygems_plugin.rb +23 -0
  53. metadata +5 -10
  54. data/lib/rdoc/generator/template/darkfish/.document +0 -0
  55. data/lib/rdoc/generator/template/darkfish/_sidebar_VCS_info.rhtml +0 -19
  56. data/lib/rdoc/generator/template/darkfish/_sidebar_in_files.rhtml +0 -9
  57. data/lib/rdoc/generator/template/json_index/.document +0 -1
data/lib/rdoc/stats.rb CHANGED
@@ -261,7 +261,7 @@ class RDoc::Stats
261
261
 
262
262
  report = []
263
263
 
264
- cm.each_attribute do |attr|
264
+ cm.attributes.each do |attr|
265
265
  next if attr.documented?
266
266
  line = attr.line ? ":#{attr.line}" : nil
267
267
  report << " #{attr.definition} :#{attr.name} # in file #{attr.file.full_name}#{line}\n"
@@ -331,7 +331,7 @@ class RDoc::Stats
331
331
 
332
332
  report = []
333
333
 
334
- cm.each_constant do |constant|
334
+ cm.constants.each do |constant|
335
335
  # TODO constant aliases are listed in the summary but not reported
336
336
  # figure out what to do here
337
337
  next if constant.documented? || constant.is_alias_for
data/lib/rdoc/store.rb CHANGED
@@ -94,11 +94,7 @@ class RDoc::Store
94
94
 
95
95
  attr_accessor :path
96
96
 
97
- ##
98
- # The RDoc::RDoc driver for this parse tree. This allows classes consulting
99
- # the documentation tree to access user-set options, for example.
100
-
101
- attr_accessor :rdoc
97
+ attr_reader :options
102
98
 
103
99
  ##
104
100
  # Type of ri datastore this was loaded from. See RDoc::RI::Driver,
@@ -124,11 +120,11 @@ class RDoc::Store
124
120
  ##
125
121
  # Creates a new Store of +type+ that will load or save to +path+
126
122
 
127
- def initialize path = nil, type = nil
128
- @dry_run = false
129
- @encoding = nil
130
- @path = path
131
- @rdoc = nil
123
+ def initialize(options, path: nil, type: nil)
124
+ @options = options
125
+ @dry_run = options.dry_run
126
+ @encoding = options.encoding
127
+ @path = path || options.op_dir
132
128
  @type = type
133
129
 
134
130
  @cache = {
@@ -139,10 +135,10 @@ class RDoc::Store
139
135
  :c_singleton_class_variables => {},
140
136
  :encoding => @encoding,
141
137
  :instance_methods => {},
142
- :main => nil,
138
+ :main => options.main_page,
143
139
  :modules => [],
144
140
  :pages => [],
145
- :title => nil,
141
+ :title => options.title,
146
142
  }
147
143
 
148
144
  @classes_hash = {}
@@ -197,6 +193,18 @@ class RDoc::Store
197
193
  top_level
198
194
  end
199
195
 
196
+ ##
197
+ # Make sure any references to C variable names are resolved to the corresponding class.
198
+ #
199
+
200
+ def resolve_c_superclasses
201
+ @classes_hash.each_value do |klass|
202
+ if klass.superclass.is_a?(String) && (candidate = find_c_enclosure(klass.superclass))
203
+ klass.superclass = candidate
204
+ end
205
+ end
206
+ end
207
+
200
208
  ##
201
209
  # Sets the parser of +absolute_name+, unless it from a source code file.
202
210
 
@@ -754,7 +762,7 @@ class RDoc::Store
754
762
  save_method klass, method
755
763
  end
756
764
 
757
- klass.each_attribute do |attribute|
765
+ klass.attributes.each do |attribute|
758
766
  save_method klass, attribute
759
767
  end
760
768
  end
data/lib/rdoc/text.rb CHANGED
@@ -99,8 +99,8 @@ module RDoc::Text
99
99
  # Requires the including class to implement #formatter
100
100
 
101
101
  def markup text
102
- if @store.rdoc.options
103
- locale = @store.rdoc.options.locale
102
+ if @store.options
103
+ locale = @store.options.locale
104
104
  else
105
105
  locale = nil
106
106
  end
data/lib/rdoc/version.rb CHANGED
@@ -5,6 +5,6 @@ module RDoc
5
5
  ##
6
6
  # RDoc version you are using
7
7
 
8
- VERSION = '6.8.1'
8
+ VERSION = '6.13.1'
9
9
 
10
10
  end
data/lib/rdoc.rb CHANGED
@@ -1,8 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  $DEBUG_RDOC = nil
3
3
 
4
- # :main: README.rdoc
5
-
6
4
  ##
7
5
  # RDoc produces documentation for Ruby source files by parsing the source and
8
6
  # extracting the definition for classes, modules, methods, includes and
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ # If this file is exist, RDoc generates and removes documents by rubygems plugins.
4
+ #
5
+ # In follwing cases,
6
+ # RubyGems directly exectute RDoc::RubygemsHook.generation_hook and RDoc::RubygemsHook#remove to generate and remove documents.
7
+ #
8
+ # - RDoc is used as a default gem.
9
+ # - RDoc is a old version that doesn't have rubygems_plugin.rb.
10
+
11
+ require_relative 'rdoc/rubygems_hook'
12
+
13
+ # To install dependency libraries of RDoc, you need to run bundle install.
14
+ # At that time, rdoc/markdown is not generated.
15
+ # If generate and remove are executed at that time, an error will occur.
16
+ # So, we can't register generate and remove to Gem at that time.
17
+ begin
18
+ require_relative 'rdoc/markdown'
19
+ rescue LoadError
20
+ else
21
+ Gem.done_installing(&RDoc::RubyGemsHook.method(:generate))
22
+ Gem.pre_uninstall(&RDoc::RubyGemsHook.method(:remove))
23
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.8.1
4
+ version: 6.13.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Hodel
@@ -11,10 +11,9 @@ authors:
11
11
  - Zachary Scott
12
12
  - Hiroshi SHIBATA
13
13
  - ITOYANAGI Sakura
14
- autorequire:
15
14
  bindir: exe
16
15
  cert_chain: []
17
- date: 2024-11-19 00:00:00.000000000 Z
16
+ date: 2025-03-29 00:00:00.000000000 Z
18
17
  dependencies:
19
18
  - !ruby/object:Gem::Dependency
20
19
  name: psych
@@ -105,13 +104,10 @@ files:
105
104
  - lib/rdoc/generator/pot/po.rb
106
105
  - lib/rdoc/generator/pot/po_entry.rb
107
106
  - lib/rdoc/generator/ri.rb
108
- - lib/rdoc/generator/template/darkfish/.document
109
107
  - lib/rdoc/generator/template/darkfish/_footer.rhtml
110
108
  - lib/rdoc/generator/template/darkfish/_head.rhtml
111
- - lib/rdoc/generator/template/darkfish/_sidebar_VCS_info.rhtml
112
109
  - lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml
113
110
  - lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml
114
- - lib/rdoc/generator/template/darkfish/_sidebar_in_files.rhtml
115
111
  - lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml
116
112
  - lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml
117
113
  - lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml
@@ -163,7 +159,6 @@ files:
163
159
  - lib/rdoc/generator/template/darkfish/servlet_not_found.rhtml
164
160
  - lib/rdoc/generator/template/darkfish/servlet_root.rhtml
165
161
  - lib/rdoc/generator/template/darkfish/table_of_contents.rhtml
166
- - lib/rdoc/generator/template/json_index/.document
167
162
  - lib/rdoc/generator/template/json_index/js/navigation.js
168
163
  - lib/rdoc/generator/template/json_index/js/searcher.js
169
164
  - lib/rdoc/i18n.rb
@@ -215,6 +210,7 @@ files:
215
210
  - lib/rdoc/parser/c.rb
216
211
  - lib/rdoc/parser/changelog.rb
217
212
  - lib/rdoc/parser/markdown.rb
213
+ - lib/rdoc/parser/prism_ruby.rb
218
214
  - lib/rdoc/parser/rd.rb
219
215
  - lib/rdoc/parser/ripper_state_lex.rb
220
216
  - lib/rdoc/parser/ruby.rb
@@ -246,6 +242,7 @@ files:
246
242
  - lib/rdoc/token_stream.rb
247
243
  - lib/rdoc/tom_doc.rb
248
244
  - lib/rdoc/version.rb
245
+ - lib/rubygems_plugin.rb
249
246
  - man/ri.1
250
247
  homepage: https://ruby.github.io/rdoc
251
248
  licenses:
@@ -254,7 +251,6 @@ metadata:
254
251
  homepage_uri: https://ruby.github.io/rdoc
255
252
  source_code_uri: https://github.com/ruby/rdoc
256
253
  changelog_uri: https://github.com/ruby/rdoc/releases
257
- post_install_message:
258
254
  rdoc_options:
259
255
  - "--main"
260
256
  - README.rdoc
@@ -271,8 +267,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
271
267
  - !ruby/object:Gem::Version
272
268
  version: '2.2'
273
269
  requirements: []
274
- rubygems_version: 3.5.11
275
- signing_key:
270
+ rubygems_version: 3.6.2
276
271
  specification_version: 4
277
272
  summary: RDoc produces HTML and command-line documentation for Ruby projects
278
273
  test_files: []
File without changes
@@ -1,19 +0,0 @@
1
- <%- if !svninfo.empty? then %>
2
- <div id="file-svninfo-section" class="nav-section">
3
- <h3>VCS Info</h3>
4
-
5
- <div class="section-body">
6
- <dl class="svninfo">
7
- <dt>Rev
8
- <dd><%= svninfo[:rev] %>
9
-
10
- <dt>Last Checked In
11
- <dd><%= svninfo[:commitdate].strftime('%Y-%m-%d %H:%M:%S') %>
12
- (<%= svninfo[:commitdelta] %> ago)
13
-
14
- <dt>Checked in by
15
- <dd><%= svninfo[:committer] %>
16
- </dl>
17
- </div>
18
- </div>
19
- <%- end -%>
@@ -1,9 +0,0 @@
1
- <div id="file-list-section" class="nav-section">
2
- <h3>Defined In</h3>
3
-
4
- <ul>
5
- <%- klass.in_files.each do |tl| -%>
6
- <li><%= h tl.relative_name %>
7
- <%- end -%>
8
- </ul>
9
- </div>
@@ -1 +0,0 @@
1
- # ignore all files in this directory