Skip to content

Instantly share code, notes, and snippets.

@czj
Created September 29, 2011 15:43
Show Gist options
  • Save czj/1251031 to your computer and use it in GitHub Desktop.
Save czj/1251031 to your computer and use it in GitHub Desktop.
.irbrc that runs Pry instead of IRB
# This script comes from Pry Everywhere by Luca Pette
# http://lucapette.com/pry/pry-everywhere/
# https://github.com/carlhuda/bundler/issues/183#issuecomment-1149953
if defined?(::Bundler)
global_gemset = ENV['GEM_PATH'].split(':').grep(/ruby.*@global/).first
if global_gemset
all_global_gem_paths = Dir.glob("#{global_gemset}/gems/*")
all_global_gem_paths.each do |p|
gem_path = "#{p}/lib"
$LOAD_PATH << gem_path
end
end
end
# Use Pry everywhere
require "rubygems"
require 'pry'
Pry.start
exit
@max-reznichenko
Copy link

Thanks for sharing this

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