Created
July 9, 2017 11:48
-
-
Save masoo/ccdd84a8ff0e453ca13e154ce61639a0 to your computer and use it in GitHub Desktop.
ruby-csharp_script sample #9
This file contains 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
# coding: utf-8 | |
require 'ruby/csharp_script' | |
csharp_script = Ruby::CSharpScript::CSharpScript.new | |
code = <<"EOS" | |
using System; | |
for (int i=0; i<10; i++) { | |
Console.WriteLine("C#: " + i.ToString(" 0")); | |
} | |
1+1 | |
EOS | |
result = csharp_script.evaluate_async(code) | |
puts "Ruby: " + result.to_s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment