Skip to content

Instantly share code, notes, and snippets.

@samullen
Created April 1, 2010 15:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samullen/351918 to your computer and use it in GitHub Desktop.
Save samullen/351918 to your computer and use it in GitHub Desktop.
# requires and stuff go here
def load_irbrc(path)
return if (path == ENV["HOME"]) || (path == '/')
load_irbrc(File.dirname path)
irbrc = File.join(path, ".irbrc")
load irbrc if File.exists?(irbrc)
end
# other ruby code in your .irbrc
load_irbrc Dir.pwd # probably should stay at the bottom
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment