Skip to content

Instantly share code, notes, and snippets.

View saoj's full-sized avatar

Sergio Oliveira Jr. saoj

View GitHub Profile
@saoj
saoj / eigenclass_bug.rb
Created February 22, 2011 19:52
This is an eigenclass (singleton class) annoying bug that was fixed in Ruby 1.9.2
# Add method filter to array
class Array
def filter(str)
self.sort.select do |m|
m =~ /^#{str}/i
end
end