Skip to content

Commit

Permalink
Squelch warning about useless variable
Browse files Browse the repository at this point in the history
The title_id variable is necessary and used by ERB via binding.
  • Loading branch information
cbandy committed Nov 11, 2014
1 parent 9cb584a commit 43141a0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/simplecov-html.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@ def formatted_source_file(source_file)

# Returns a table containing the given source files
def formatted_file_list(title, source_files)
title_id = title.gsub(/^[^a-zA-Z]+/, '').gsub(/[^a-zA-Z0-9\-\_]/, '')
title_id # Ruby will give a warning when we do not use this except via the binding :( FIXME
# Silence a warning by using the following variable to assign to itself:
# "warning: possibly useless use of a variable in void context"
# The variable is used by ERB via binding.
title_id = title_id = title.gsub(/^[^a-zA-Z]+/, '').gsub(/[^a-zA-Z0-9\-\_]/, '')
template('file_list').result(binding)
end

Expand Down

0 comments on commit 43141a0

Please sign in to comment.