root/lang/ruby/Chemr/rb_main.rb @ 669

Revision 643, 0.7 kB (checked in by cho45, 7 years ago)

lang/ruby/Chemr,
lang/ruby/Chemr/main.m,
lang/ruby/Chemr/Rakefile,
lang/ruby/Chemr/Info.plist,
lang/ruby/Chemr/AppController.rb,
lang/ruby/Chemr/rb_main.rb,
lang/ruby/Chemr/Chemr.xcodeproj,
lang/ruby/Chemr/Chemr.xcodeproj/project.pbxproj,
lang/ruby/Chemr/English.lproj,
lang/ruby/Chemr/English.lproj/MainMenu.nib,
lang/ruby/Chemr/English.lproj/MainMenu.nib/info.nib,
lang/ruby/Chemr/English.lproj/MainMenu.nib/classes.nib:

Chemr is a CHM (HTML Help) Viewer on Mac OS X.

Line 
1#
2#  rb_main.rb
3#  Chemr
4#
5#  Created by さとう on Tue Oct 23 2007.
6#  Copyright (c) 2007 «ORGANIZATIONNAME». All rights reserved.
7#
8
9require 'osx/cocoa'
10
11OSX.require_framework "/System/Library/Frameworks/WebKit.framework"
12
13def log(*args)
14        args.each do |m|
15                OSX.NSLog m.inspect
16        end
17end
18
19def _(key)
20        NSLocalizedString(key, '').to_s
21end
22
23def rb_main_init
24        path = OSX::NSBundle.mainBundle.resourcePath.fileSystemRepresentation
25        rbfiles = Dir.entries(path).select {|x| /\.rb\z/ =~ x}
26        rbfiles -= [ File.basename(__FILE__) ]
27        rbfiles.each do |path|
28                require( File.basename(path) )
29        end
30end
31
32if $0 == __FILE__ then
33        rb_main_init
34        OSX.NSApplicationMain(0, nil)
35end
Note: See TracBrowser for help on using the browser.