summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2023-09-05 09:48:11 +0900
committergit <svn-admin@ruby-lang.org>2023-09-05 01:14:51 +0000
commit736092ec11c4a3e4aa643434a54b135a648765ea (patch)
tree568db177d8a8f0959a6162e6f6a5181238025c1b /lib
parent3f6c92e9d592a2b122fb2260fccee7a7dd850cb8 (diff)
[ruby/rdoc] Remove code for versions older than Ruby 2.3
https://github.com/ruby/rdoc/commit/a61b777df0
Diffstat (limited to 'lib')
-rw-r--r--lib/rdoc/comment.rb7
-rw-r--r--lib/rdoc/encoding.rb7
2 files changed, 2 insertions, 12 deletions
diff --git a/lib/rdoc/comment.rb b/lib/rdoc/comment.rb
index 63197492c4..fecdcac782 100644
--- a/lib/rdoc/comment.rb
+++ b/lib/rdoc/comment.rb
@@ -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
diff --git a/lib/rdoc/encoding.rb b/lib/rdoc/encoding.rb
index cf60badd24..8a921c7011 100644
--- a/lib/rdoc/encoding.rb
+++ b/lib/rdoc/encoding.rb
@@ -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