# Overrides Tracker
Overrides Tracker keeps track of all overriding methods in your project and allows for comparison across branches.
[](https://badge.fury.io/rb/overrides_tracker)
[](https://coveralls.io/github/SyborgStudios/overrides_tracker?branch=master)
[](https://dl.circleci.com/status-badge/redirect/gh/SyborgStudios/overrides_tracker/tree/master)
## Contact
*Code and Bug Reports*
* [Issue Tracker](https://github.com/SyborgStudios/overrides_tracker/issues)
* See [CONTRIBUTING]
Getting started
---------------
1. Add OverridesTracker to your Gemfile and bundle install:
```ruby
gem 'overrides_tracker', group: [:test, :development]
```
2. Add `overrides_tracker/*.otf` to your .gitignore file because you want to keep hold of your report file when switching branches.
3. Track you overrides by running:
```ruby
bundle exec overrides_tracker track
```
The output will look like this.
```
Reading all methods...
Checking...AClass
Checking...BClass
Method is a new instance method: AClass#a_new_method
Method is instance override: AClass#a_instance_method_override
.
.
.
Checking...YClass
Method is a new singleton method: YClass#a_new_method
Method is singleton override: YClass#a_singelton_method_override
Checking...ZClass
===========
Report saved to /PATH_TO_PROJECT/overrides_tracker/BRANCH_NAME#LAST_COMMIT_ID.otf
```
4. This will create a folder called overrides_tracker and a file containing all methods you override as well as your overrides in that branch.
5. Switch branch and follow steps 1-3 again. If you want to compare multiple branches you need to redo these steps for every branch.
6. Now you have at least 2 files in the overrides_tracker folder
7. It's time to compare these overrides accross branches.
```ruby
bundle exec overrides_tracker compare
````
8. The result gives you an overview on what has changed and what not.
```
===========================================================================================
1) Override: OrdinaryGem::AnotherTypicalClass#a_singleton_method_that_stays_the_same
...........................................................................................
main#cc5a31dc4833734a177f01bd161047f8c7909e16.otf
-------------------------------------------------------------------------------------------
Original:
def self.a_singleton_method_that_stays_the_same
"This is the implementation of a simple singleton method."
"This method will stay the same in the next version."
end
in BUNDLE_PATH/bundler/gems/ordinary-gem-e67e062189bb/lib/ordinary_gem/another_typical_class.rb:19
-------------------------------------------------------------------------------------------
Override:
def self.a_singleton_method_that_stays_the_same
"This is our override of a simple singleton method."
"This method should stay the same in the next version."
end
in: APP_PATH/app/models/ordinary_gem/another_typical_class_monkey_patch.rb:2
...........................................................................................
attached-to-next-version#a7231014c006a4a5848eb4d92bb465eb5c89ee01.otf
-------------------------------------------------------------------------------------------
Original:
def self.a_singleton_method_that_stays_the_same
"This is the implementation of a simple singleton method."
"This method will stay the same in the next version."
end
in BUNDLE_PATH/bundler/gems/ordinary-gem-f92e5a1a70a6/lib/ordinary_gem/another_typical_class.rb:13
-------------------------------------------------------------------------------------------
Override:
def self.a_singleton_method_that_stays_the_same
"This is our override of a simple singleton method."
"This method should stay the same in the next version."
end
in: APP_PATH/app/models/ordinary_gem/another_typical_class_monkey_patch.rb:2
...........................................................................................
main#1d279724b26c9491e6e5a01e9711b61a73e9f7e0.otf
Method not available
...........................................................................................
.
.
.
.
===========================================================================================
Summary:
Investigated methods: 70
Diffences on overrides: 42
Diffences on added methods: 28
```
## Overrides.io integration
Overrides.io is a service that monitors code you override for changes. It notifies you whenever those changes occur.
Additionally it gives you a beautiful overview of all the methods you have overridden as well as your overrides side by side.