[ruby/rdoc] Remove code for versions older than Ruby 2.3

https://github.com/ruby/rdoc/commit/a61b777df0
This commit is contained in:
Nobuyoshi Nakada 2023-09-05 09:48:11 +09:00 committed by git
parent 3f6c92e9d5
commit 736092ec11
2 changed files with 2 additions and 12 deletions

View File

@ -133,12 +133,7 @@ class RDoc::Comment
# HACK dubious
def encode! encoding
# TODO: Remove this condition after Ruby 2.2 EOL
if RUBY_VERSION < '2.3.0'
@text = @text.force_encoding encoding
else
@text = String.new @text, encoding: encoding
end
@text = String.new @text, encoding: encoding
self
end

View File

@ -124,12 +124,7 @@ module RDoc::Encoding
if text.kind_of? RDoc::Comment
text.encode! encoding
else
# TODO: Remove this condition after Ruby 2.2 EOL
if RUBY_VERSION < '2.3.0'
text.force_encoding encoding
else
String.new text, encoding: encoding
end
String.new text, encoding: encoding
end
end