Commit graph

89 commits

Author SHA1 Message Date
Stan Lo
03eb777c69 Sync RDoc 6.14.0 2025-05-22 15:04:47 -07:00
OKURA Masafumi
895f2c2152 [ruby/rdoc] lint: Remove unreachable code
(https://github.com/ruby/rdoc/pull/1137)

This is an attempt to utilize RuboCop further.
RuboCop was added in 9262fdd43a
but only a few rules have been enabled.
I believe we can utilize RuboCop more for better code quality,
especially with Lint cops.
This is the first step to enable other Lint cops.
This commit also exclude some auto generated files.

a53287fce0
2024-12-08 23:14:18 +00:00
Stan Lo
2ecd2fe0ed [ruby/rdoc] Deprecate main and title directives
(https://github.com/ruby/rdoc/pull/1218)

* Deprecate :main: directive

* Deprecate :title: direcive

* Update documentation

* Remove :main: directive's usage

* Update test cases

* Add '.rdoc_options' to suggested alternatives

e2d4ac9dad
2024-12-05 11:36:34 +00:00
Hiroshi SHIBATA
d85e8b5339 Reapply "[ruby/rdoc] fix: C variables should never show up in Ancestors tree"
This reverts commit 0fe82ae087.
2024-12-03 10:59:32 +09:00
Hiroshi SHIBATA
0fe82ae087
Revert "[ruby/rdoc] fix: C variables should never show up in Ancestors tree"
This reverts commit 2923f42ed7.

3375565361 (step):23:1031

```
/home/runner/work/actions/actions/snapshot-master/lib/rdoc/code_object.rb:322:in 'RDoc::CodeObject#parent': undefined method 'find_class_or_module' for nil (NoMethodError)
	from /home/runner/work/actions/actions/snapshot-master/lib/rdoc/code_object/class_module.rb:342:in 'RDoc::ClassModule#marshal_dump'
	from /home/runner/work/actions/actions/snapshot-master/lib/rdoc/store.rb:878:in 'Marshal.dump'
	from /home/runner/work/actions/actions/snapshot-master/lib/rdoc/store.rb:878:in 'block in RDoc::Store#save_class'
	from /home/runner/work/actions/actions/snapshot-master/lib/rdoc/store.rb:877:in 'IO.open'
	from /home/runner/work/actions/actions/snapshot-master/lib/rdoc/store.rb:877:in 'RDoc::Store#save_class'
	from /home/runner/work/actions/actions/snapshot-master/lib/rdoc/store.rb:763:in 'block in RDoc::Store#save'
	from /home/runner/work/actions/actions/snapshot-master/lib/rdoc/store.rb:762:in 'Array#each'
	from /home/runner/work/actions/actions/snapshot-master/lib/rdoc/store.rb:762:in 'RDoc::Store#save'
	from /home/runner/work/actions/actions/snapshot-master/lib/rdoc/generator/ri.rb:27:in 'RDoc::Generator::RI#generate'
	from /home/runner/work/actions/actions/snapshot-master/lib/rdoc/rdoc.rb:528:in 'block in RDoc::RDoc#generate'
	from /home/runner/work/actions/actions/snapshot-master/lib/rdoc/rdoc.rb:522:in 'Dir.chdir'
	from /home/runner/work/actions/actions/snapshot-master/lib/rdoc/rdoc.rb:522:in 'RDoc::RDoc#generate'
	from /home/runner/work/actions/actions/snapshot-master/lib/rdoc/rdoc.rb:501:in 'RDoc::RDoc#document'
	from ./tool/rdoc-srcdir:27:in '<main>'
```
2024-12-02 09:39:56 +09:00
Mike Dalessio
2923f42ed7 [ruby/rdoc] fix: C variables should never show up in Ancestors tree
(https://github.com/ruby/rdoc/pull/1217)

If a NormalClass's superclass is a C enclosure, then update the
superclass to point to the RDoc::NormalClass.

This is done in a single pass after all files have been parsed.

Fixes https://github.com/ruby/rdoc/pull/1205.

1ecd9581b1
2024-11-30 12:31:42 +00:00
Stan Lo
098649bc59 [ruby/rdoc] Add home page link to output message
(https://github.com/ruby/rdoc/pull/1165)

The link is clickable in the terminal and opens the home page in the browser

b7d580afab
2024-09-27 13:58:36 +00:00
David Rodríguez
786d000652 [ruby/rdoc] Avoid potentially loading the same extension from different versions of the same gem
Avoids warnings like

```
/path/to/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/rbs-3.4.0/lib/rdoc/discover.rb:10: warning: method redefined; discarding old scan
/path/to/ruby/3.3.4/lib/ruby/gems/3.3.0/gems/rbs-3.5.1/lib/rdoc/discover.rb:10: warning: previous definition of scan was here
```

e47920d8f3
2024-08-19 11:48:42 +00:00
Stan Lo
27c22f822a [ruby/rdoc] Drop unnecessary file_name parameter from Parser.for
method.
(https://github.com/ruby/rdoc/pull/1135)

* Unify top_level creation in tests

* Remove unnecessary file_name param from Parser.for

It should be always the same as the top_level's absolute_name, so there's
no point of taking it as a separate parameter.

97c497dfbb
2024-07-31 14:36:41 +00:00
zzak
8b2884c0b5 [ruby/rdoc] Isolate root dir if specified
This ensures only files from the root directory are chosen, in order to allow a clean build from outside the source directory.

f3b389aa9e
2023-05-06 07:39:24 +00:00
Nobuyoshi Nakada
cd65e4adca [ruby/rdoc] Use File.binread
987c609df9
2023-03-31 01:14:34 +00:00
Sven Riedel
e0901f46b7 [ruby/rdoc] Add --no-skipping-tests option
33925f885f
2022-11-28 04:36:29 +00:00
Nobuyoshi Nakada
3b3fb73d61 [ruby/rdoc] Dump plain objects as RDoc::Options
So that the generated `.rdoc_options` file is loadable.

6cf6e1647b
2022-02-12 16:15:08 +09:00
Ulysse Buonomo
5348a34504 [ruby/rdoc] Relative loading for easier development (https://github.com/ruby/rdoc/pull/821)
This patch makes sure we only load relative code. Hence when coding or
testing rdoc, we'll be sure to always be using the correct code.

Discussion started at https://github.com/ruby/rdoc/pull/817.

Signed-off-by: Ulysse Buonomo <buonomo.ulysse@gmail.com>

aa41bd48eb

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2022-02-12 15:06:06 +09:00
aycabta
cf2faf2e33 [ruby/rdoc] Move RDoc::RDoc#load_options to RDoc::RDoc.load_options
ac85e01756
2021-09-02 00:32:13 +09:00
aycabta
c264d30261 Use YAML.safe_load to use the permitted_classes option 2021-05-21 21:45:03 +09:00
aycabta
b1c73f239f [ruby/rdoc] Use File.open to fix the OS Command Injection vulnerability in CVE-2021-31799
a7f5d6ab88
2021-05-21 13:42:24 +09:00
Yusuke Endoh
ffdf0232ef lib/rdoc/rdoc.rb: Allow only RDoc::Options in .rdoc_options
Follow-up of d8fd92f620. Instead of using
unsafe_load blindly, RDoc::Options is only supposed to be allowed.
2021-05-17 12:53:42 +09:00
Hiroshi SHIBATA
d8fd92f620
Workaround with fbb4e3f96c in rdoc 2021-05-17 12:04:40 +09:00
aycabta
61a29a41e1 [ruby/rdoc] Allow empty .rdoc_options
0c8cb25b50
2021-03-16 15:47:27 +09:00
aycabta
971a0cd246 [ruby/rdoc] Allow partial default values to be overridden with .rdoc_options
e14800891f
2021-03-16 15:47:27 +09:00
Nobuyoshi Nakada
e23f0f29da [ruby/rdoc] update all files if any file is newer
Cross references need parse all files which define the subject
names.  This commit makes `--force-update` option enforce to parse
all files if any file is newer than the previous parse, not only
updated files.

13e9a44896
2020-09-18 14:57:58 +09:00
Marc-Andre Lafortune
867f0c6793 [ruby/rdoc] Prefer require_relative 2020-09-14 12:59:11 -04:00
Nobuyoshi Nakada
2b7409a2f2
Specify explicit separator not to be affected by $; 2020-03-08 17:38:37 +09:00
kazu
44aaff6d31 [DOC] Fix close tags [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-04 09:10:10 +00:00
aycabta
1b43644edc Merge rdoc-6.1.0.beta2
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-17 06:28:20 +00:00
hsbt
98c7058bf7 Merge RDoc 6.0.3 from upstream.
It fixed the several bugs that was found after RDoc 6 releasing.

From: SHIBATA Hiroshi <hsbt@ruby-lang.org>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62924 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-26 05:56:26 +00:00
hsbt
5551871086 Merge rdoc-6.0.0.beta4 from upstream.
It version applied `frozen_string_literal: true`

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-27 10:45:24 +00:00
hsbt
cdc527db34 * lib/rdoc/*, test/rdoc/*: Update rdoc-5.0.0
Release note: b825775647/History.rdoc (500--2016-11-05)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-05 09:18:10 +00:00
hsbt
ba6ae341ba * lib/rdoc/*, test/rdoc/*: Update rdoc-5.0.0.beta2
Fixed ri parse defect with left-hand matched classes.
  https://github.com/rdoc/rdoc/pull/420

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-09-07 22:23:38 +00:00
hsbt
23863ff75d * lib/rdoc/*, test/rdoc/*: Update rdoc/rdoc master(f191513)
https://github.com/rdoc/rdoc/blob/master/History.rdoc#423--2016--
  https://github.com/rdoc/rdoc/blob/master/History.rdoc#422--2016-02-09

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-09-05 10:35:30 +00:00
naruse
3e92b635fb Add frozen_string_literal: false for all files
When you change this to true, you may need to add more tests.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16 05:07:31 +00:00
hsbt
94c5f5a77c * lib/rdoc/*: Update rdoc master(cfffed5)
https://github.com/rdoc/rdoc/pull/337
  https://github.com/rdoc/rdoc/pull/367

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-28 07:05:17 +00:00
hsbt
d42d6e690e * lib/rdoc.rb, lib/rdoc, test/rdoc: Update to RDoc 4.2.0.alpha(313287)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47391 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-05 01:41:25 +00:00
drbrain
df7dac9174 * lib/rdoc: Update to RDoc 4.1.0.preview.1
RDoc 4.1.0 contains a number of enhancements including a new default
  style and accessibility support.  You can see the changelog here:

  https://github.com/rdoc/rdoc/blob/v4.1.0.preview.1/History.rdoc

* test/rdoc:  ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-18 23:33:36 +00:00
drbrain
d8c7695fbb * lib/rdoc/class_module.rb: Fixed duplicate comments for classes and
modules from C.
* test/rdoc/test_rdoc_class_module.rb:  Test for the above.

* lib/rdoc/parser/c.rb:  Reload C variable names to allow proper
  updates of an ri store for C files.
* lib/rdoc/rdoc.rb:  ditto.
* lib/rdoc/store.rb:  ditto.
* test/rdoc/test_rdoc_parser_c.rb:  Test for the above.
* test/rdoc/test_rdoc_store.rb:  ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-13 07:58:47 +00:00
drbrain
b65b75bf2c * lib/rdoc/options.rb: Added --page-dir option for moving pages in
doc/ to the top-level.
* lib/rdoc/rdoc.rb:  ditto.
* test/rdoc/test_rdoc_options.rb:  Test for the above.
* test/rdoc/test_rdoc_rdoc.rb:  ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38311 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-11 07:44:56 +00:00
drbrain
6d1266a879 * lib/rdoc/*: Added --root option for building documentation outside
the source directory.
* test/rdoc/*:  ditto
* common.mk (rdoc):  Added --root to rdoc rule


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-27 08:54:03 +00:00
drbrain
1c279a7d27 * lib/rdoc*: Updated to RDoc 4.0 (pre-release)
* bin/rdoc:  ditto
* test/rdoc:  ditto
* NEWS:  Updated with RDoc 4.0 information


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37889 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-27 04:28:14 +00:00
drbrain
b7528b5edb * lib/rdoc.rb: Import RDoc 3.7 release candidate
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32115 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-16 04:59:24 +00:00
drbrain
0b6da24a5e * lib/rdoc.rb: Updated to RDoc 3.6
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-14 00:39:16 +00:00
drbrain
7ed51785df * lib/rdoc/rdoc.rb: Output summary after documentation report.
* lib/rdoc/stats/normal.rb:  Don't output information for users when
	  we're not on a TTY


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31542 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-12 23:41:35 +00:00
drbrain
cc2a16d94d Import RDoc 3.5.1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-02 00:32:30 +00:00
drbrain
9d767bc265 There is no Perl parser in RDoc 3 ☹
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-20 03:32:22 +00:00
drbrain
2ef9c50c6e Import RDoc 3
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-20 03:22:49 +00:00
marcandre
571ed8655f * lib/rdoc/*.rb: Remove unused variable warnings.
Patch by Run Paint [ruby-core:30991]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-08 20:58:28 +00:00
nobu
8e9f30887c * lib/rdoc/rdoc.rb (RDoc#read_file_contents): take care of BOM.
[ruby-dev:41452]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28062 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-29 03:05:55 +00:00
drbrain
75ef9e79d6 Import RDoc 2.5.4
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-19 05:08:28 +00:00
drbrain
ff5366a705 Update to RDoc 2.5.3
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27295 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-11 01:34:28 +00:00
naruse
7f72d102cb * lib/rdoc/rdoc.rb (setup_output_dir): compare by Time#to_i.
Cached created time doesn't have fractinal times,
  but FileStat#mtime has; so rdoc almost alway judged files
  are updated.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27290 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-11 00:00:43 +00:00