public
Description: A RubyCocoa client for Webistrano (http://labs.peritor.com/webistrano)
Homepage: http://mattmatt.github.com/macistrano
Clone URL: git://github.com/mattmatt/macistrano.git
macistrano / rb_main.rb
100644 28 lines (23 sloc) 0.646 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
#
# rb_main.rb
# macistrano
#
# Created by Pom on 22.04.08.
# Copyright (c) 2008, 2009 Mathias Meyer. All rights reserved.
#
 
if defined?(COCOA_APP_RESOURCES_DIR)
  $LOAD_PATH << File.join(File.dirname(COCOA_APP_RESOURCES_DIR),"Frameworks","RubyCocoa.framework", "Resources", "ruby")
end
 
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