Skip to content

Instantly share code, notes, and snippets.

View seanlerner's full-sized avatar

Sean Lerner seanlerner

View GitHub Profile
@seanlerner
seanlerner / seans-ruby-helpers.rb
Last active March 11, 2022 16:59
Sean's Ruby Helpers
<<-HOW_TO_USE
Paste this line into any ruby console if you dare:
require 'net/http'; url = 'https://gist.githubusercontent.com/seanlerner/092ce4caec301d758b524adbd715242a/raw/seans-ruby-helpers.rb'; eval(Net::HTTP.get(URI(url)))
HOW_TO_USE
def exception_message(exception)
if exception.message.include?("undefined method `include'")
@wtaysom
wtaysom / where_is.rb
Created September 23, 2011 08:57
A little Ruby module for finding the source location where class and methods are defined.
module Where
class <<self
attr_accessor :editor
def is_proc(proc)
source_location(proc)
end
def is_method(klass, method_name)
source_location(klass.method(method_name))