-
Notifications
You must be signed in to change notification settings - Fork 1
/
irbrc
62 lines (57 loc) · 1.83 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/ruby
# frozen_string_literal: true
# require 'rubygems'
# require 'irb/completion'
# require 'irb/ext/save-history'
# require 'interactive_editor'
ARGV.push('--readline', '--prompt-mode', 'simple')
IRB.conf[:USE_READLINE] = true
IRB.conf[:SAVE_HISTORY] = 9999
IRB.conf[:HISTORY_FILE] = "#{ENV["HOME"]}/.irb_history"
IRB.conf[:PROMPT_MODE] = :SIMPLE
IRB.conf[:AUTO_INDENT] = true
puts 'Loaded irbrc'
##
# With bootsnap being prevalent everywhere
# Hijacking the loadpath on my dev machine is more of a headache
# This is currently no longer worth the effort
#
# # ==============================
# # PRY BYEBUG https://github.com/deivid-rodriguez/pry-byebug
# # ==============================
# # Try to force pry-byebug
# begin
# extra_gem_locations = []
# require 'bundler'
# Bundler.with_unbundled_env do
# # gem dependency pry-doc --version '>= 0.10'
# extra_gem_locations = %x{ dirname `gem which 'pry'` }
# extra_gem_locations << %x{ dirname `gem which 'niceql'` }
# extra_gem_locations << %x{ dirname `gem which 'pry-byebug'` }
# extra_gem_locations << %x{ dirname `gem which 'byebug'` }
# end
# # puts extra_gem_locations
# extra_gem_locations.split("\n").each do |gem_location|
# # puts gem_location
# $LOAD_PATH.unshift(File.join(File.dirname(gem_location), 'lib'))
# end
# # puts $LOAD_PATH
# ::Kernel.require('pry-byebug')
# ::Kernel.require('niceql')
# rescue => e
# puts "oh well, maybe try rbenv exec gem install 'pry-byebug'"
# puts e.message if e.message
# puts e.cause if e.cause
# puts e.backtrace if e.backtrace
# end
# # Try to use Pry everywhere
# begin
# require 'pry'
# Pry.start
# exit # exit once pry exits
# rescue => e
# puts "oh well, try gem install 'pry-byebug'"
# puts e.message if e.message
# puts e.cause if e.cause
# puts e.backtrace if e.backtrace
# end