Skip to content

Instantly share code, notes, and snippets.

@gerhard
Created July 14, 2010 10:26
Show Gist options
  • Save gerhard/475280 to your computer and use it in GitHub Desktop.
Save gerhard/475280 to your computer and use it in GitHub Desktop.
require 'irb/completion'
require 'pp'
IRB.conf[:AUTO_INDENT]=true
if defined?(Rails) == 'constant'
spec_helper = Rails.root + "spec/spec_helper.rb"
require spec_helper if File.exists?(spec_helper)
end
@hakanensari
Copy link

Alas, I get this annoying warning when I add this to irbrc:

irb: warn: can't alias context from irb_context.

@gerhard
Copy link
Author

gerhard commented Jul 15, 2010

You're right, it is annoying, and it's related to rspec, but I prefer that to having to type require 'spec/spec_helper' every time I run console. Google doesn't offer any great suggestions, so I'm OK to leave it like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment