From: Craig W. <cwi...@ma...> - 2008-06-11 15:26:49
|
On Jun 11, 2008, at 9:19 AM, Eloy Duran wrote: > Could you paste the source code it creates in rb_main.rb ? > I think the problem lies there. > > I'll be gone for a few hours though, so I won't be able to respond > quickly. > > Eloy Here it is. Also, the RubyCocoa.framework is in the Frameworks folder of the bundle. Craig ################################################################################ # standaloneify.rb patch ################################################################################ # Remove all entries that aren't in the application bundle COCOA_APP_RESOURCES_DIR = File.dirname(__FILE__) $LOAD_PATH.reject! { |d| d.index(File.dirname(COCOA_APP_RESOURCES_DIR))!=0 } $LOAD_PATH << File.join(COCOA_APP_RESOURCES_DIR,"ThirdParty") $LOAD_PATH << File.join(File.dirname(COCOA_APP_RESOURCES_DIR),"lib") $LOADED_FEATURES << "rubycocoa.bundle" ENV['GEM_HOME'] = ENV['GEM_PATH'] = File.join(COCOA_APP_RESOURCES_DIR,"RubyGems") ################################################################################ # # rb_main.rb # ScriptWindow # # Created by Craig Williams on 5/30/08. # Copyright (c) 2008 __MyCompanyName__. All rights reserved. # require 'osx/cocoa' include OSX 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 |