Skip to content
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

Silence @track_files_glob ivar warning #447

Merged
merged 1 commit into from
Jan 25, 2016
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions lib/simplecov.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ def start(profile = nil, &block)
# their coverage to zero.
#
def add_not_loaded_files(result)
if @track_files_glob
if track_files
result = result.dup
Dir[@track_files_glob].each do |file|
Dir[track_files].each do |file|
absolute = File.expand_path(file)

result[absolute] ||= [0] * File.foreach(absolute).count
Expand Down
5 changes: 3 additions & 2 deletions lib/simplecov/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ def coverage_path
# or not they were explicitly required. Without this, un-required files
# will not be present in the final report.
#
def track_files(glob)
@track_files_glob = glob
def track_files(glob = nil)
return @track_files if defined?(@track_files) && glob.nil?
@track_files = glob
end

#
Expand Down