Commit 369f964
committed
Prevent RDoc from polluting in_files
There is currently a bug in RDoc v6.5.0 that causes the value of
`RDoc::ClassModule#in_files` to become polluted when referring to a
constant nested in a module where the module has been previously seen
but the constant has not. For example, if RDoc sees a core extension
like:
```ruby
class Float
def as_json(*)
# ...
end
end
```
and later sees a reference to `Float::INFINITY` in a file `foo.rb`, then
it will add `foo.rb` to `in_files` for `Float`. That will cause
`foo.rb` to appear in `public/classes/Float.html` and `Float` to appear
in `public/files/foo.rb`.
This commit monkey patches RDoc to prevent such pollution. The monkey
patch has been tested with the test suites of RDoc v6.5.0 and RDoc
`master` as of ruby/rdoc@9e75bf6, and
all tests pass.1 parent d0e2ead commit 369f964
File tree
2 files changed
+44
-0
lines changed- lib/sdoc
- spec
2 files changed
+44
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
50 | 78 | | |
0 commit comments