-
Notifications
You must be signed in to change notification settings - Fork 1
/
.irbrc
38 lines (33 loc) · 956 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
require 'rubygems'
require 'rake'
require 'win32console' if RUBY_PLATFORM =~ /(mswin|mingw|cygwin)32$/i
begin
require 'wirble'
require 'hirb'
rescue LoadError
# no pretty console output :(
end
if defined? Wirble
Wirble.init
Wirble.colorize
end
Hirb.enable if defined? Hirb
IRB.conf[:PROMPT_MODE] = :SIMPLE
IRB.conf[:AUTO_INDENT] = true
IRB.conf[:IRB_RC] = proc do |conf|
name = "irb: "
name = "rails: " if $0 == 'irb' && ENV['RAILS_ENV']
leader = " " * name.length
conf.prompt_i = "#{name}"
conf.prompt_s = leader + '\-" '
conf.prompt_c = leader + '\-+ '
conf.return_format = ('=' * (name.length - 2)) + "> %s\n"
end
class Object
def my_methods(include_inherited = false)
ignored_methods = include_inherited ? Object.methods : self.class.superclass.instance_methods
(self.methods - ignored_methods).sort
end
end
# log ActiveRecord (Rails 3)
ActiveRecord::Base.logger = Logger.new(STDOUT) if defined? Rails::Console