public
Description: Native OS X (RubyCocoa) app to manage your EC2 instances
Clone URL: git://github.com/bricooke/ec2mgr.git
Search Repo:
ec2mgr / rb_main.rb
100644 30 lines (25 sloc) 0.612 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#
# rb_main.rb
# EC2Mgr
#
# Created by Brian Cooke on 7/7/08.
# Copyright (c) 2008 roobasoft, LLC. See LICENSE
#
 
require 'osx/cocoa'
include OSX
 
Thread.abort_on_exception = true
 
%w(EMKeychainProxy EMKeyChainItem).each do |class_name|
  OSX.ns_import class_name.to_sym
end
 
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