codecov / codecov-ruby

Ruby uploader for Codecov
https://codecov.io
MIT License
73 stars 82 forks source link

Fix issue with shortened filenames when Simplecov.root is a substring #10

Closed mcgain closed 8 years ago

mcgain commented 8 years ago

If SimpleCov.root happens to be contained more than once in a file path, all occurrences will be removed by shortened_filename.

For example, the path when SimpleCov.root is /app: app/app/controllers/application_controller.rb will be shortened to ../controllers/.lication_controller.rb

To fix this, I use a regex to only substitute the root at the start of a file path.

@stevepeak