Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/toch/trace_calls
Trace the whole chain of method calls.
https://github.com/toch/trace_calls
Last synced: 23 days ago
JSON representation
Trace the whole chain of method calls.
- Host: GitHub
- URL: https://github.com/toch/trace_calls
- Owner: toch
- License: gpl-3.0
- Created: 2015-09-08T14:45:27.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-09-08T14:46:21.000Z (about 9 years ago)
- Last Synced: 2024-04-25T12:43:11.128Z (7 months ago)
- Language: Ruby
- Size: 125 KB
- Stars: 20
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# TraceCalls
Trace the whole chain of method calls.
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'trace_calls'
```And then execute:
$ bundle
Or install it yourself as:
$ gem install trace_calls
## Usage
```
require 'open-uri'
require 'trace_calls'TraceCalls::on do
open('http://google.com', proxy: nil)
endputs TraceCalls::root
```The result:
```
+-Kernel::open
+-#::parse called from Kernel::open at 33
| \-URI::Parser::parse called from #::parse at 747
| | +-URI::Parser::split called from URI::Parser::parse at 211
| | +-#::scheme_list called from URI::Parser::parse at 213
| | +-#::scheme_list called from URI::Parser::parse at 214
| | \-URI::HTTP::initialize called from URI::Parser::parse at 660
| | | \-URI::Generic::initialize called from URI::HTTP::initialize at 84
| | | | +-URI::Generic::set_scheme called from URI::Generic::initialize at 203
| | | | +-URI::Generic::set_userinfo called from URI::Generic::initialize at 204
| | | | | \-URI::Generic::split_userinfo called from URI::Generic::set_userinfo at 525
...
```If you want full details, i.e. with the filepath and line, you can use
```
puts TraceCalls::root.to_s(detailed: true)
```## Contributing
1. Fork it ( https://github.com/toch/trace_calls/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request