-
Notifications
You must be signed in to change notification settings - Fork 21
/
irbrc
40 lines (33 loc) · 1.25 KB
/
irbrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# ------------------------------------------------------------------------------
# FILE: .irbrc
# DESCRIPTION: IRB configuration file
# AUTHOR: Sorin Ionescu <[email protected]>
# VERSION: 1.0.0
# ------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
# General Options
# ------------------------------------------------------------------------------
# Add all gems in the global gemset to the $LOAD_PATH; so, they can be used even
# in places like 'rails console'.
# 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
# ------------------------------------------------------------------------------
# Improved Console
# ------------------------------------------------------------------------------
begin
# Use Pry everywhere
require "rubygems" unless defined? Gem
require 'pry'
Pry.start
exit
rescue LoadError
end