[macruby-changes] [691] MacRuby/trunk
source_changes at macosforge.org
source_changes at macosforge.org
Fri Oct 31 15:59:27 PDT 2008
Revision: 691
http://trac.macosforge.org/projects/ruby/changeset/691
Author: lsansonetti at apple.com
Date: 2008-10-31 15:59:27 -0700 (Fri, 31 Oct 2008)
Log Message:
-----------
introduce -[MacRuby loadBridgeSupportFileAtPath:] and -[MacRuby loadBridgeSupportFileAtURL:], booh
Modified Paths:
--------------
MacRuby/trunk/include/ruby/objc.h
MacRuby/trunk/objc.m
Modified: MacRuby/trunk/include/ruby/objc.h
===================================================================
--- MacRuby/trunk/include/ruby/objc.h 2008-10-31 01:27:34 UTC (rev 690)
+++ MacRuby/trunk/include/ruby/objc.h 2008-10-31 22:59:27 UTC (rev 691)
@@ -27,6 +27,14 @@
*/
- (id)evaluateString:(NSString *)expression;
+/* Load the BridgeSupport file at the given path.
+ */
+- (void)loadBridgeSupportFileAtPath:(NSString *)path;
+
+/* Load the BridgeSupport file at the given URL.
+ */
+- (void)loadBridgeSupportFileAtURL:(NSURL *)URL;
+
@end
@interface NSObject (MacRubyAdditions)
Modified: MacRuby/trunk/objc.m
===================================================================
--- MacRuby/trunk/objc.m 2008-10-31 01:27:34 UTC (rev 690)
+++ MacRuby/trunk/objc.m 2008-10-31 22:59:27 UTC (rev 691)
@@ -3470,6 +3470,19 @@
return [self evaluateFileAtPath:[URL relativePath]];
}
+- (void)loadBridgeSupportFileAtPath:(NSString *)path
+{
+ rb_objc_load_bridge_support([path fileSystemRepresentation], 0);
+}
+
+- (void)loadBridgeSupportFileAtURL:(NSURL *)URL
+{
+ if (![URL isFileURL]) {
+ [NSException raise:NSInvalidArgumentException format:@"given URL is not a file URL"];
+ }
+ [self loadBridgeSupportFileAtPath:[URL relativePath]];
+}
+
@end
@implementation NSObject (MacRubyAdditions)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20081031/0043c880/attachment.html>
More information about the macruby-changes
mailing list