Rails 沙盒中的语言 [英] Language in a Sandbox in Rails
问题描述
我发现有一个沙盒 gem(由制作在浏览器中尝试 ruby 的人创建 但它只与 Ruby 1.8 兼容.另一个问题是我再也找不到它了(似乎他们停止从服务器提供 gem ......).
I've found that there WAS a sandbox gem (created by the guys that made try ruby in your browser but it was compatible only with Ruby 1.8. Another problem is that I cannot find it anymore (it seems they stop serving the gem from the servers...).
那么,是否有任何安全方式在沙箱中运行 ruby(以便您可以从浏览器运行它)?或者在沙箱中运行(例如 lua/python)(无文件系统访问,不创建对象等)并从 Ruby(Rails 2.2)调用的简单方法?
So, is there any secure way of running ruby in a sandbox (so you can run it from your browser)? Or an easy way to run (for example lua/python) in a sandbox (no filesystem access, no creation of objects etc) and be called from Ruby (Rails 2.2)?
即使下面没有红宝石,我也想制作一个像 try_ruby 这样的应用程序.但它必须是一种简单的语言(我看到 ruby 中有一个 prolog,甚至是 lisp,但我认为它们不容易学习语言......).
I want to make an application like try_ruby even without having a ruby underneath. But it has to be an easy language (I saw there was a prolog in ruby, even a lisp but I don't think they are easy to learn languages...).
那么,您有什么建议或提示吗?或者我应该开始在 Ruby 中创建我自己的 DSL(如果有创建一个有点安全的系统的解决方案)?
So, do you have any suggestions or tips? Or should I just start creating my own DSL in Ruby (if there is a solution in creating a somewhat safe system)?
谢谢
推荐答案
我正在开发一个基于对用 C 编写的 ruby 解释器的修改的 ruby 沙箱的实现,我最近发布了一个名为 gem 的功能版本shikashi (rdoc 文档).
I am developing an implementation of a sandbox for ruby based on a modification of the ruby interpreter written in C, I have released recently a functional version of the gem called shikashi (rdoc documentation).
这篇关于Rails 沙盒中的语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!