-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathirbrc
More file actions
26 lines (23 loc) · 696 Bytes
/
irbrc
File metadata and controls
26 lines (23 loc) · 696 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
# load rubygems and wirble
require 'rubygems' rescue nil
require 'wirble'
# load wirble
Wirble.init
Wirble.colorize
class Object
def methods_with_sort(filter = nil)
methods = methods_without_sort
if filter
filter = Regexp.new(filter.to_s, true) unless filter.is_a? Regexp
methods = methods.select { |method| method =~ filter }
end
methods.sort
end
alias_method :methods_without_sort, :methods
alias_method :methods, :methods_with_sort
def instance_variables_with_sort
instance_variables_without_sort.sort
end
alias_method :instance_variables_without_sort, :instance_variables
alias_method :instance_variables, :instance_variables_with_sort
end