Revisions
-
kyab revised this gist
Dec 18, 2011 . 2 changed files with 4 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,11 +3,12 @@ int main(void) { id fooClass; id foo; [[MacRuby sharedRuntime] evaluateFileAtPath:@"test.rb"]; fooClass = [[MacRuby sharedRuntime] evaluateString:@"Foo"]; foo = [fooClass performRubySelector:@selector(new) withArguments:@"from Objc", NULL]; NSLog(@"%@", foo); NSLog(@"%@", [foo hello]); } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,3 @@ class Foo def initialize(str = "") -
Watson1978 created this gist
Dec 17, 2011 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ #import <Foundation/Foundation.h> #import <MacRuby/MacRuby.h> int main(void) { id ruby; id foo; ruby = [[MacRuby sharedRuntime] evaluateFileAtPath:@"test.rb"]; foo = [ruby performRubySelector:@selector(main:) withArguments:@"from Objc", NULL]; NSLog(@"%@", foo); NSLog(@"%@", [foo hello]); } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ def main(str) Foo.new(str) end class Foo def initialize(str = "") @str = str.to_s end def hello "Hello, MacRuby #{@str}" end end