开发者

How to make OSX application that just runs opens some file type and runs arbitrary Ruby code?

It's trivial to make a program executable from shell - just put #!/usr/bin/ruby on top, chmod +x it and done. Unfortunately OSX won't let me associate file type with such scripts - it requires its .apps instead. This sort of distinction doesn't seem to exist on other operating systems.

What's the simplest way of making such .app, which would merely execute some arbitrary Ruby c开发者_如何学Goode?


You could use Automator or create an AppleScript application using "do shell script" to execute your Ruby script.


It seems that Script Editor has "Save as Application Bundle" option, which creates foo.app which I can associate with file types.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜