您将如何制作一个在浏览器中运行的在线 IRB
我想知道如何创建一个在浏览器中运行的在线 IRB。我有一个想法,在我的博客中包含一个 irb 控制台,并为用户提供将我的教程中的代码块直接发送到 irb 控制台的选项,以便他们可以使用它。
_为什么以前这样做,但现在它当然消失了: 缓存版本
Im wondering how to go about creating an online IRB that runs in the browser. I have an idea to include an irb console in my blog and give the option for users to send code blocks in my tutorials directly into the irb console so they can play around with it.
_Why did this previously, but of course it is gone now: Cached Version
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
TryRuby 仍然可以在此处使用,GitHub 上的源代码。
TryRuby is still available here, with source code at GitHub.
好吧,您可以使用_why 创建的沙箱。但你需要能够修补你的 ruby 并且它似乎只适用于 ruby 1.8.5 。
Well, you could use the sandbox that _why created. But you'll need to be able to patch your ruby and it seems to only work on ruby 1.8.5 .
这太危险了。不要这样做。当您允许用户执行任意 Ruby 代码时,您的系统就会面临各种漏洞。
无论如何,JavaScript/Flash 中有一些客户端 Ruby 实现。看看 HotRuby。
That's insanely dangerous. Don't do this. You expose your system to all sorts of vulnerabilities when you allow users to execute arbitrary Ruby code.
Anyway there are some client-side Ruby implementations in JavaScript/Flash. Take a look at HotRuby.
我怀疑您在沙箱中运行 Ruby 是为了防止运行“坏”命令。
I would suspect you run Ruby in a sandbox to prevent "bad" commands being run.