简体   繁体   中英

How do I bundle Ruby Scripts with my JAR and get make calls to them

I'd like to bundle some Ruby Scripts with my jar, nothing too fancy just some standard regex processing and log processing.

I don't want to force my scripts to live outside the JAR.

Calls to the scripts are nothing more than asking the scripts to run top to bottom with a couple or arguments.

I currently distribute my app in two parts, a jar and scripts in a zip but I don't want to do this.

Can JRuby help me? Is there another way?

I'd like to do something like

//Java Code
exec("ruby script arguments");
// Java Code

any help?

Perhaps you want to look at the 'StandaloneJarsAndClasses" part of the JRuby project on github. It reads, "You may also want to bundle JRuby plus your own Ruby code into a single .jar file that when run launches your application...."

https://github.com/jruby/jruby/wiki/StandaloneJarsAndClasses

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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