banister / method_source

return the sourcecode for a method
MIT License
361 stars 43 forks source link

Removed file caching to allow live reloading of files #27

Open crismali opened 9 years ago

crismali commented 9 years ago

This way if you reload a file that defines a proc or a method the source updates. It also prevents SourceNotFound errors in case the proc or method definition moves within the file.

jairovm commented 3 years ago

I'd be good to have a public API to delete a file from this hash, right now I'm doing this

MethodSource.instance_variable_get(:@lines_for_file).delete(absolute_path)

but it feels kind of weird 🤔, thanks guys.