Skip to content

Instantly share code, notes, and snippets.

@masoo
Created July 9, 2017 11:48
Show Gist options
  • Save masoo/ccdd84a8ff0e453ca13e154ce61639a0 to your computer and use it in GitHub Desktop.
Save masoo/ccdd84a8ff0e453ca13e154ce61639a0 to your computer and use it in GitHub Desktop.
ruby-csharp_script sample #9
# 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