Skip to content

Commit

Permalink
fallback to overview.html when pages do not exist for compare option
Browse files Browse the repository at this point in the history
  • Loading branch information
rishijain committed Oct 16, 2023
1 parent 1d20e4f commit 05b560e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -3,6 +3,7 @@
* [CHANGE] Fix test warning related to `cucumber_opts` declaration (by [@faisal][])
* [BUGFIX] Stop using long-deprecated MiniTest module name, removed in 5.19.0 (by [@faisal][])
* [CHANGE] Disable VERBOSE warnings in test stubs (by [@fbuys][])
* [BUGFIX] Use overview.html as the fallback path when files does not exist during compare option (by [@rishijain][])

# v4.8.1 / 2023-05-17 [(commits)](https://github.com/whitesmith/rubycritic/compare/v4.8.0...v4.8.1)

Expand Down
4 changes: 3 additions & 1 deletion lib/rubycritic/generators/html/view_helpers.rb
Expand Up @@ -24,7 +24,9 @@ def smell_location_path(location)
end

def code_index_path(root_directory, file_name)
file_path("#{File.expand_path(root_directory)}/#{file_name}")
file_path = "#{File.expand_path(root_directory)}/#{file_name}"
file_path = file_path('overview.html') unless File.exist?(file_path)
file_path(file_path)
end

private
Expand Down

0 comments on commit 05b560e

Please sign in to comment.