Skip to content

Commit

Permalink
Remove code for versions older than Ruby 2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu committed Sep 5, 2023
1 parent a61b777 commit 0d10f46
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
8 changes: 2 additions & 6 deletions lib/rdoc/erbio.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

##
Expand Down
6 changes: 1 addition & 5 deletions lib/rdoc/generator/darkfish.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0d10f46

Please sign in to comment.