Skip to content

Instantly share code, notes, and snippets.

@ahmetabdi
Last active April 21, 2016 12:48
Show Gist options
  • Save ahmetabdi/a2f44f21217349f36c5ddcd2e2c9a606 to your computer and use it in GitHub Desktop.
Save ahmetabdi/a2f44f21217349f36c5ddcd2e2c9a606 to your computer and use it in GitHub Desktop.
Rails Debugging
# Figure out where a method was defined
object = Object.new
puts object.method(:blank?).source_location
=> ["/gems/activesupport-5.0.0.beta1/lib/active_support/core_ext/object/blank.rb", 14]
# Opening a dependency from a project
$ bundle open active_support
# Un-debug a gem
gem pristine activesupport
# Generate backtrace
puts caller
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment