diff options
author | alpaca-tc <[email protected]> | 2024-03-08 18:23:36 +0900 |
---|---|---|
committer | git <[email protected]> | 2024-03-08 09:23:40 +0000 |
commit | e8f796e954a7007620825f8d15796e458d1493bb (patch) | |
tree | f3e6b820799a80c3ab287fbe77a293253b5d46dd /lib | |
parent | 86ce78d73acad53992d080ad6bc9b0dbf3dc0a79 (diff) |
[ruby/irb] rdoc version lock is required
(https://github.com/ruby/irb/pull/897)
Some features of irb do not work properly when using the old rdoc.
I have compared several major versions and found that it works as intended from 4.0.0.
This problem occurs when there is a Gemfile.lock is installed with the old rdoc.
I don't know why this Gemfile.lock installs an older rdoc than the ruby bundled rdoc,
but specifying the version in the gemspec will at least prevent the problem.
NOTE: ruby/irb#704 problem does not occur with this change.
The following is test code.
```
### Usage: ruby __FILE__.rb
# # input RDoc and Tab
# >> RDoc<Tab>
#
### Expect: Display document of RDoc
### Actual: <internal:marshal>:34:in `load': instance of RDoc::Constant needs to have method `marshal_load' (TypeError)
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
gem 'irb'
# gem 'rdoc', '~> 4.0.0'
gem 'rdoc', '~> 3.12.0'
end
require 'rdoc'
require 'irb'
IRB.start
```
https://github.com/ruby/irb/commit/1a1fbba020
Diffstat (limited to 'lib')
-rw-r--r-- | lib/irb/irb.gemspec | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/irb/irb.gemspec b/lib/irb/irb.gemspec index 6ed327a273..b29002f593 100644 --- a/lib/irb/irb.gemspec +++ b/lib/irb/irb.gemspec @@ -42,5 +42,5 @@ Gem::Specification.new do |spec| spec.required_ruby_version = Gem::Requirement.new(">= 2.7") spec.add_dependency "reline", ">= 0.4.2" - spec.add_dependency "rdoc" + spec.add_dependency "rdoc", ">= 4.0.0" end |