-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathirbrc
More file actions
31 lines (26 loc) · 674 Bytes
/
irbrc
File metadata and controls
31 lines (26 loc) · 674 Bytes
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
require 'pp'
# Note: this doesn't load wirble for rails c
# for that you need to include wirble in Gemfile
begin
# load wirble
require 'wirble'
# start wirble (with color)
Wirble.init
Wirble.colorize
rescue LoadError => err
warn "Couldn't load Wirble: #{err}"
end
# Easily print local methods
class Object
def local_methods
(methods - Object.instance_methods).sort
end
end
# Log to STDOUT if in Rails
if ENV.include?('RAILS_ENV') && !Object.const_defined?('RAILS_DEFAULT_LOGGER')
require 'logger'
RAILS_DEFAULT_LOGGER = Logger.new(STDOUT)
end
# '.' no longer used since it's a security risk
# do require './myfile' instead
# $LOAD_PATH << '.'