If you’re Ruby metaprogramming and you need to call send several levels deep, give this little utility method I made a try:
class Object
def deep_send(s)
s.split(’.').inject(self) { |memo, obj| memo ? memo.send(obj) : nil }
end
end
Then you can say some_object.deep_send(’this.that.whatever’), instead of a bunch of inject/Proc messiness.
TextMate rules!… until you hit Command+Shift+F and try to do a ‘Find in Project’
It beach balls because it’s searching huge log files. You can fix this by going to Preferences -> Advanced -> Folder References and entering this value for ‘Folder Pattern:
‘!.*/(\.[^/]*|log|.svn|CVS|_darcs|_MTN|\{arch\}|blib|.*~\.nib|.*\.(framework|app|pbproj|pbxproj|xcode(proj)?|bundle))$
I just added log and .svn to it (.svn may not be necessary, [...]