https://github.com/hmarr/monkey_hunter
Find out what a Ruby library monkey patches
https://github.com/hmarr/monkey_hunter
Last synced: about 1 year ago
JSON representation
Find out what a Ruby library monkey patches
- Host: GitHub
- URL: https://github.com/hmarr/monkey_hunter
- Owner: hmarr
- Created: 2015-06-30T13:08:22.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-06-30T13:08:36.000Z (almost 11 years ago)
- Last Synced: 2025-02-06T12:33:04.909Z (over 1 year ago)
- Language: Ruby
- Homepage:
- Size: 97.7 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Monkey Hunter
Find out what a Ruby library monkey patches.
## Usage
Run `monkey-hunter` followed by the name of a local gem you want to inspect.
```shell
$ monkey-hunter wasabi
I, [2014-12-31T17:35:05.065213 #92062] INFO -- : Loading the ruby standard library
I, [2014-12-31T17:35:05.370915 #92062] INFO -- : Loading httpi
I, [2014-12-31T17:35:05.433993 #92062] INFO -- : Loading nokogiri
I, [2014-12-31T17:35:05.530610 #92062] INFO -- : Taking initial snapshot
I, [2014-12-31T17:35:06.736542 #92062] INFO -- : Loading wasabi
I, [2014-12-31T17:35:06.746281 #92062] INFO -- : Taking final snapshot
String
#snakecase()
(from Wasabi::CoreExt::String)
```
## How it works
1. Load the entire Ruby standard library
2. Load all dependencies of the library in question (e.g. for 'wasabi', load
'httpi' and 'nokogiri')
3. Loop through every class and module in the Ruby VM (using the ObjectSpace
module), and make a record of the instance methods, singleton methods, and
constants
4. Load the library in question (in the example above, 'wasabi')
5. Repeat step 3, taking another snapshot of the object graph
6. Diff the two object graph snapshots
7. Report what has changed!