Skip to content

Commit a61b777

Browse files
committed
Remove code for versions older than Ruby 2.3
1 parent e3688de commit a61b777

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

lib/rdoc/comment.rb

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,7 @@ def empty?
133133
# HACK dubious
134134

135135
def encode! encoding
136-
# TODO: Remove this condition after Ruby 2.2 EOL
137-
if RUBY_VERSION < '2.3.0'
138-
@text = @text.force_encoding encoding
139-
else
140-
@text = String.new @text, encoding: encoding
141-
end
136+
@text = String.new @text, encoding: encoding
142137
self
143138
end
144139

lib/rdoc/encoding.rb

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,7 @@ def self.change_encoding text, encoding
124124
if text.kind_of? RDoc::Comment
125125
text.encode! encoding
126126
else
127-
# TODO: Remove this condition after Ruby 2.2 EOL
128-
if RUBY_VERSION < '2.3.0'
129-
text.force_encoding encoding
130-
else
131-
String.new text, encoding: encoding
132-
end
127+
String.new text, encoding: encoding
133128
end
134129
end
135130

0 commit comments

Comments
 (0)