7 ms·
For what it's worth, if you're just looking to get at the innards of a method, Pry does this job admirably. https://gist.github.com/cheald/6674718 https://gist
by cheald 13y ago
For what it's worth, if you're just looking to get at the innards of a method, Pry does this job admirably.
https://gist.github.com/cheald/6674718 https://gist.github.com/cheald/6674718
https://github.com/pry/pry/wiki/Source-browsing https://github.com/pry/pry/wiki/Source-browsing
Or to get the source as a string:
> require 'pry'
> Nokogiri.method(:HTML).source
=> " def HTML thing, url = nil, encoding = nil, options = XML::ParseOptions::DEFAULT_HTML, &block\n Nokogiri::HTML::Document.parse(thing, url, encoding, options, &block)\n end\n"
- VeejayRampay 13y agoPry is awesome. You can even navigate your source shell-style and do all sorts of fancy things with it. Great little gem.