Skip to content

Instantly share code, notes, and snippets.

View ggilder's full-sized avatar

Gabriel Gilder ggilder

View GitHub Profile
@ggilder
ggilder / TextMate_scriptmate_fix.rb
Created November 3, 2010 22:35
Fix TextMate's scriptmate.rb to work with Ruby 1.9
# located at /Applications/TextMate.app/Contents/SharedSupport/Support/lib/scriptmate.rb
# change lines 12 - 13:
$KCODE = 'u' if (RUBY_VERSION.to_f < 1.9)
require "jcode" unless "".respond_to? :each_char
# rest of the file is unchanged
@ggilder
ggilder / restoreObjcMethodSignature.rb
Created October 19, 2010 04:28
Restore an Objective-C method signature from MacRuby's automatic Ruby-style conversion (such as that passed to method_missing)
# Takes an Objective-C method signature, automatically converted to "Ruby-style" by MacRuby, and restores it.
# Restored method and arguments are returned in an array.
def restoreObjcMethodSignature(method, args)
if ((args.length == 2) && (args[1].is_a? Hash))
method = method+':'+args[1].keys.join(':')
args = [args[0], *args[1].values]
end
[method, args]
end