-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.irbrc
47 lines (40 loc) · 922 Bytes
/
.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
require 'rubygems'
require 'wirble'
if defined? Wirble
Wirble.init
Wirble.colorize
colors = Wirble::Colorize.colors.merge({
:comma => :green,
:refers => :green,
})
Wirble::Colorize.colors = colors
end
begin
require 'awesome_print'
rescue LoadError => ex
warn ex
end
if defined? Rails::Console
require "#{Rails.root}/spec/spec_helper" if File.exists?("#{Rails.root}/spec/spec_helper.rb")
begin
ActiveRecord::Base.logger = Logger.new(STDOUT)
ActiveResource::Base.logger = Logger.new(STDOUT)
rescue => ex
warn ex
end
if defined? Hirb
Hirb.enable
end
end
if ENV.include?('RAILS_ENV') && !Object.const_defined?('RAILS_DEFAULT_LOGGER')
require 'logger'
RAILS_DEFAULT_LOGGER = Logger.new(STDOUT)
end
class Object
def interesting_methods
(self.methods - Object.new.methods).sort
end
def which_method(method_name)
self.method(method_name.to_sym)
end
end