Skip to content

Instantly share code, notes, and snippets.

@orta
Created May 20, 2011 18:55
Show Gist options
  • Save orta/983537 to your computer and use it in GitHub Desktop.
Save orta/983537 to your computer and use it in GitHub Desktop.
#
# rb_main.rb
# photouploader
#
# Created by orta on 26/03/2011.
# Copyright (c) 2011 http://www.ortatherox.com. All rights reserved.
#
# Loading the Cocoa framework. If you need to load more frameworks, you can
# do that here too.
framework 'Cocoa'
require 'rubygems'
require 'rest_client'
require 'json'
require 'aws/s3'
# Loading all the Ruby project files.
main = File.basename(__FILE__, File.extname(__FILE__))
dir_path = NSBundle.mainBundle.resourcePath.fileSystemRepresentation
Dir.glob(File.join(dir_path, '*.{rb,rbo}')).map { |x| File.basename(x, File.extname(x)) }.uniq.each do |path|
if path != main
if !path.include? "_test"
require(path)
end
end
end
# Starting the Cocoa main loop.
NSApplicationMain(0, nil)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment