Skip to content

Commit

Permalink
Remove code for versions older than Ruby 2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu committed Sep 5, 2023
1 parent e3688de commit a61b777
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
7 changes: 1 addition & 6 deletions lib/rdoc/comment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,7 @@ def empty?
# 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

Expand Down
7 changes: 1 addition & 6 deletions lib/rdoc/encoding.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,7 @@ def self.change_encoding text, 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

Expand Down

0 comments on commit a61b777

Please sign in to comment.