Skip to content

Fix for warnings on Ruby 2.5 in ERB binding #544

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 48 additions & 20 deletions lib/rdoc/generator/darkfish.rb
Original file line number Diff line number Diff line change
Expand Up @@ -313,12 +313,16 @@ def generate_index
search_index_rel_prefix = rel_prefix
search_index_rel_prefix += @asset_rel_path if @file_output

# suppress 1.9.3 warning
asset_rel_prefix = asset_rel_prefix = rel_prefix + @asset_rel_path
asset_rel_prefix = rel_prefix + @asset_rel_path

@title = @options.title

render_template template_file, out_file do |io| binding end
render_template template_file, out_file do |io|
here = binding
# suppress 1.9.3 warning
here.local_variable_set(:asset_rel_prefix, asset_rel_prefix)
here
end
rescue => e
error = RDoc::Error.new \
"error generating index.html: #{e.message} (#{e.class})"
Expand All @@ -343,14 +347,19 @@ def generate_class klass, template_file = nil
search_index_rel_prefix = rel_prefix
search_index_rel_prefix += @asset_rel_path if @file_output

# suppress 1.9.3 warning
asset_rel_prefix = asset_rel_prefix = rel_prefix + @asset_rel_path
svninfo = svninfo = get_svninfo(current)
asset_rel_prefix = rel_prefix + @asset_rel_path
svninfo = get_svninfo(current)

@title = "#{klass.type} #{klass.full_name} - #{@options.title}"

debug_msg " rendering #{out_file}"
render_template template_file, out_file do |io| binding end
render_template template_file, out_file do |io|
here = binding
# suppress 1.9.3 warning
here.local_variable_set(:asset_rel_prefix, asset_rel_prefix)
here.local_variable_set(:svninfo, svninfo)
here
end
end

##
Expand Down Expand Up @@ -416,8 +425,7 @@ def generate_file_files
search_index_rel_prefix = rel_prefix
search_index_rel_prefix += @asset_rel_path if @file_output

# suppress 1.9.3 warning
asset_rel_prefix = asset_rel_prefix = rel_prefix + @asset_rel_path
asset_rel_prefix = rel_prefix + @asset_rel_path

unless filepage_file then
if file.text? then
Expand All @@ -434,7 +442,14 @@ def generate_file_files
@title += " - #{@options.title}"
template_file ||= filepage_file

render_template template_file, out_file do |io| binding end
putes template_file.inspect
render_template template_file, out_file do |io|
here = binding
# suppress 1.9.3 warning
here.local_variable_set(:asset_rel_prefix, asset_rel_prefix)
here.local_variable_set(:current, current)
here
end
end
rescue => e
error =
Expand All @@ -458,14 +473,19 @@ def generate_page file
search_index_rel_prefix = rel_prefix
search_index_rel_prefix += @asset_rel_path if @file_output

# suppress 1.9.3 warning
current = current = file
asset_rel_prefix = asset_rel_prefix = rel_prefix + @asset_rel_path
current = file
asset_rel_prefix = rel_prefix + @asset_rel_path

@title = "#{file.page_name} - #{@options.title}"

debug_msg " rendering #{out_file}"
render_template template_file, out_file do |io| binding end
render_template template_file, out_file do |io|
here = binding
# suppress 1.9.3 warning
here.local_variable_set(:current, current)
here.local_variable_set(:asset_rel_prefix, asset_rel_prefix)
here
end
end

##
Expand All @@ -483,12 +503,16 @@ def generate_servlet_not_found message
search_index_rel_prefix = rel_prefix
search_index_rel_prefix += @asset_rel_path if @file_output

# suppress 1.9.3 warning
asset_rel_prefix = asset_rel_prefix = ''
asset_rel_prefix = ''

@title = 'Not Found'

render_template template_file do |io| binding end
render_template template_file do |io|
here = binding
# suppress 1.9.3 warning
here.local_variable_set(:asset_rel_prefix, asset_rel_prefix)
here
end
rescue => e
error = RDoc::Error.new \
"error generating servlet_not_found: #{e.message} (#{e.class})"
Expand Down Expand Up @@ -540,12 +564,16 @@ def generate_table_of_contents
search_index_rel_prefix = rel_prefix
search_index_rel_prefix += @asset_rel_path if @file_output

# suppress 1.9.3 warning
asset_rel_prefix = asset_rel_prefix = rel_prefix + @asset_rel_path
asset_rel_prefix = rel_prefix + @asset_rel_path

@title = "Table of Contents - #{@options.title}"

render_template template_file, out_file do |io| binding end
render_template template_file, out_file do |io|
here = binding
# suppress 1.9.3 warning
here.local_variable_set(:asset_rel_prefix, asset_rel_prefix)
here
end
rescue => e
error = RDoc::Error.new \
"error generating table_of_contents.html: #{e.message} (#{e.class})"
Expand Down