diff --git a/lib/rdoc/comment.rb b/lib/rdoc/comment.rb index 696d011182..04ec226436 100644 --- a/lib/rdoc/comment.rb +++ b/lib/rdoc/comment.rb @@ -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 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 @@ 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 diff --git a/lib/rdoc/erbio.rb b/lib/rdoc/erbio.rb index 56c0511a3d..0f98eaedee 100644 --- a/lib/rdoc/erbio.rb +++ b/lib/rdoc/erbio.rb @@ -20,12 +20,8 @@ class RDoc::ERBIO < ERB ## # Defaults +eoutvar+ to 'io', otherwise is identical to ERB's initialize - def initialize str, safe_level = nil, legacy_trim_mode = nil, legacy_eoutvar = 'io', trim_mode: nil, eoutvar: 'io' - if RUBY_VERSION >= '2.6' - super(str, trim_mode: trim_mode, eoutvar: eoutvar) - else - super(str, safe_level, legacy_trim_mode, legacy_eoutvar) - end + def initialize str, trim_mode: nil, eoutvar: 'io' + super(str, trim_mode: trim_mode, eoutvar: eoutvar) end ## diff --git a/lib/rdoc/generator/darkfish.rb b/lib/rdoc/generator/darkfish.rb index 7a7a95a9b9..1b408a6f8e 100644 --- a/lib/rdoc/generator/darkfish.rb +++ b/lib/rdoc/generator/darkfish.rb @@ -778,11 +778,7 @@ def template_for file, page = true, klass = ERB erbout = "_erbout_#{file_var}" end - if RUBY_VERSION >= '2.6' - template = klass.new template, trim_mode: '-', eoutvar: erbout - else - template = klass.new template, nil, '-', erbout - end + template = klass.new template, trim_mode: '-', eoutvar: erbout @template_cache[file] = template template end