3c7qeq
Last Updated: February 25, 2016
·
506
· dan2552

Mac developer? Use MacRuby IRB

MacRuby is great on its own, but regardless to whether you want to actually write your applications in Ruby it's worth installing anyway just for macirb! Obviously the syntax is a bit different, but it's a nice way to quickly play around with Cocoa libraries.

Here's an example of instantiating and calling methods on NSDate:

~$ macirb
irb(main):008:0> date = NSDate.alloc.init
=> 2013-05-07 20:43:51 +0100
irb(main):009:0> date.timeIntervalSince1970
=> 1367955831.3862
irb(main):010:0>