简体   繁体   English

使您的Ruby代码模糊不清?

[英]Obscure your Ruby code?

I am in the middle of developing an enterprise application using RoR (first time for us to build an enterprise app on RoR instead of Java), and while we do not have that much problem of obscuring the source code, I was still wondering if this was possible. 我正在使用RoR开发企业应用程序(这是我们第一次在RoR上而不是Java上构建企业应用程序),尽管我们没有太多混淆源代码的问题,但是我仍然想知道这是否是可能的。 Whether we could somehow just have a simple EXE or something else, such that our code base remains hidden from the client. 无论我们是否可以仅仅拥有一个简单的EXE或其他东西,这样我们的代码库就不会对客户端隐藏。

Has anybody done anything like this or any way whether something like this could be achieved? 有没有人做过这样的事情或是否可以做到这样的事情?

Obscuring the source code is a bad idea. 混淆源代码不是一个好主意。 It makes debugging the client's (inevitable) problems a lot harder, fixing them in place all but impossible, and it even makes it harder to get useful bug tickets, because the stack traces will be full of unreadable garbage. 它使调试客户端(不可避免的)问题变得更加困难,几乎不可能将其修复到位,并且甚至使获取有用的错误通知单变得更加困难,因为堆栈跟踪中将充满不可读的垃圾。 Ultimately, it's futile - any program can be decompiled with enough effort. 最终,它是徒劳的-任何程序都可以进行足够的反编译。

This is a problem best solved with lawyers. 这是律师最好解决的问题。 A well-written contract should be all you need to prevent them copying your code. 要防止他们复制您的代码,只需要写一个好的合同即可。

You can "compile" your RoR application with JRuby in order to run it on a JVM (an idea here: http://answers.oreilly.com/topic/434-how-to-package-a-ruby-on-rails-application-for-java-ee/ ). 您可以使用JRuby“编译”您的RoR应用程序,以便在JVM上运行它(这里的想法是: http : //answers.oreilly.com/topic/434-how-to-package-a-ruby-on-rails -application-for-java-ee / )。

PS: take care at which gems you use, some of them may need to native support (so "recompiled" on the JVM) PS:请注意使用哪些gem,其中某些gem可能需要本机支持(因此在JVM上“重新编译”了)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM