Created
October 6, 2011 01:27
-
-
Save buddylindsey/1266242 to your computer and use it in GitHub Desktop.
IronRuby + .NET
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 characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| namespace ConsoleApplication2 | |
| { | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| Console.WriteLine("Wasup I am C#"); | |
| Console.WriteLine(data()); | |
| Console.ReadLine(); | |
| } | |
| static string data() | |
| { | |
| var rubyRuntime = IronRuby.Ruby.CreateRuntime(); | |
| var rubyEngine = rubyRuntime.GetEngine("rb"); | |
| rubyEngine.Execute(@" | |
| require 'drb' | |
| class MainClass | |
| def main_data | |
| s = DRbObject.new_with_uri('druby://192.168.0.104:62438') | |
| s.get_data | |
| end | |
| end | |
| "); | |
| object testClass = rubyEngine.Runtime.Globals.GetVariable("MainClass"); | |
| dynamic tester = rubyEngine.Operations.CreateInstance(testClass); | |
| return tester.main_data().ToString(); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment