可以将Rails插件打包为WAR/JAR文件吗? [英] Can a Rails plugin be packaged as a WAR/JAR file?
问题描述
能否将插件打包为JAR/WAR文件,就像打包整个Rails应用程序以便在JRuby上进行部署一样?
Can a plugin be packaged as a JAR/WAR file similar to the way in which an entire Rails app can be packaged for deployment on JRuby?
推荐答案
要么莺,或者您想做一个罐子.
either you want warbler or you want to make a jar.
如果您需要一个带有该插件的空Rails应用,请创建一个空项目,安装该插件,然后编辑config/warble.rb以复制所需的宝石
If you need an empty rails app with that plugin, create an empty project, install the plugin and, edit config/warble.rb to copy the gems you need
如果您需要一个带有该插件中的类文件的jar;您需要jrubyc将rb文件编译为类文件,然后可以使用java jar命令将其转换为jar.将该jar放入需要这些ruby类的任何Java应用程序的WEB-INF/lib中.
If you need a jar with class files from that plugin; you need jrubyc to compile the rb files to class files that you can then turn into a jar with the java jar command. Put that jar into WEB-INF/lib of any Java app that needs those ruby classes.
这篇关于可以将Rails插件打包为WAR/JAR文件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!