Cocoa-Ruby rb_main.rb
公開日:
:
最終更新日:2014/01/31
RubyCocoa
記事内に広告を含む場合があります。記事内で紹介する商品を購入することで、当サイトに売り上げの一部が還元されることがあります。
Cocoa-Rubyのメインコードはこんな感じ。
#
# rb_main.rb
# CocoaRubyTest
#
# Created by ssatou on 07/10/27.
# Copyright (c) 2007 __MyCompanyName__. All rights reserved.
#
require 'osx/cocoa'
def rb_main_init
path = OSX::NSBundle.mainBundle.resourcePath.fileSystemRepresentation
rbfiles = Dir.entries(path).select {|x| /\.rb\z/ =~ x}
rbfiles -= [ File.basename(__FILE__) ]
rbfiles.each do |path|
require( File.basename(path) )
end
end
if $0 == __FILE__ then
rb_main_init
OSX.NSApplicationMain(0, nil)
end
関連記事
- PREV
- Xcodeをインストールしてみた
- NEXT
- Dashcodeでウィジェットを作ってみる