Created
July 28, 2012 05:31
-
-
Save dtinth/3191927 to your computer and use it in GitHub Desktop.
Running Ruby
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
print("Enter your name: ") | |
puts("Hello, " + gets()) |
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
gem install therubyracer |
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
require 'v8' | |
class InputOutput | |
def gets() | |
proc do | |
STDIN.gets.chomp | |
end | |
end | |
def puts(str) | |
STDOUT.puts str | |
end | |
def print(str) | |
STDOUT.print str | |
end | |
end | |
InputOutput.new.eval_js File.read('code.js') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment