简体   繁体   English

JRuby Warbler:如何编译Ruby on Rails应用程序的所有源文件

[英]JRuby Warbler: How to compile all the source files of a Ruby on Rails App

Warbler is a fantastic gem that compiles a Jruby project(Rails) to a deployable war file. 莺是一种神奇的宝石,它将Jruby项目(Rails)编译为可部署的战争文件。 Thanks to this stackoverflow question gives the required info. 感谢这个stackoverflow 问题提供了所需的信息。

However, running warble compiled war hides all the ruby source codes, which is fine. 但是,运行warble compiled war隐藏所有ruby源代码,这很好。 But it leaves other files like the Gemfile. 但是它留下了其他文件,例如Gemfile。 Gemfile.lock etc files untouched. Gemfile.lock等文件未更改。

Is there any way to compile these files too? 有没有办法编译这些文件呢? Anything particular to be included in the config/warble.rb file that will compile these files too? config/warble.rb文件中包含的任何特别内容也可以编译这些文件吗?

An additional, but more ambitious requirement is to not show the rails directory structure in the WEB-INF at all(we are going to distribute the compiled war file to the clients.) I not not very optimistic about this, but can the rails directory structure be hidden inside the WEB-INF directory? 另一个但更雄心勃勃的要求是根本不在WEB-INF中显示rails目录结构(我们将分发已编译的war文件给客户端。)对此我不是很乐观,但是rails目录可以吗结构隐藏在WEB-INF目录内?

I don't think that's possible. 我认为那是不可能的。 I used Warbler a lot back in the days and the only things that do with compiled is to compile your source into java... Also, you cannot hide the rails folder structure because what is to simply change all require from .rb to .class and load the corresponding java compiled file. 过去,我经常使用Warbler,并且进行compiled的唯一操作就是将源代码编译为java...。此外,您无法隐藏rails文件夹结构,因为这是将所有要求从.rb更改为.class的简单方法。并加载相应的Java编译文件。

Are you using some java integration with JRuby? 您是否正在使用Java与JRuby集成? I mean, load some java lib in Ruby, otherwise you could try others way to compile your ruby to an executable like https://github.com/phusion/traveling-ruby 我的意思是,在Ruby中加载一些Java库,否则您可以尝试其他方式将ruby编译为可执行文件,例如https://github.com/phusion/traveling-ruby

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

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