Last Updated: February 25, 2016
· gregorym

Get the absolute path of a ressource in MacRuby

Let say we have a "menubar-icon.png" under /Resources in our macruby application and we want the absolute path of that file in order to do something with it.

Here is how to do it:

absolute_path = NSBundle.mainBundle.pathForResource("menubar-icon", ofType:"png")