diminish7 / rave

A Google Wave robot client framework for Ruby
http://github.com/diminish7/rave
MIT License
62 stars 8 forks source link

Need a way to include additional gems in the war #28

Closed diminish7 closed 14 years ago

diminish7 commented 14 years ago

Now that we're hiding the warbler config, we need a way to include a list of additional gems that need to be included in the war before packaging

bil-bas commented 14 years ago

Yeah, already thought of this, but hadn't got around to doing it.

bil-bas commented 14 years ago

It is done in RubyScript2exe, which is part of the Ruby distribution anyway (well, in mine, but not 100% sure it would be in others). Either should be able to pull the necessary functionality out or just use the original files if you can get away without editing.

Essentially, it would run a little ruby script which overloads the Kernel::load method so you can record which gems are loaded. It then loads the main robot file (which doesn't do anything, since it isn't being "run") and after that has completed running, can tell the app which gems are loaded. Alternatively, you could just take the easy route and put in a list of gems in the config.yaml file. I'm not too bothered which we go with, because both, in their own ways, have problems.

The important file is include2lib in RubyScript2exe, if you want to do it automatically. I started doing it, then though you might prefer to do it since you'd done all the warbler/packaging stuff (and I can't say I'm that interested in that side of it anyway ;) ). If you don't want to do it, just ask and I'll do it some time.

bil-bas commented 14 years ago

There is also, while I think of it, a need to have more files included than just robot.rb and config.yaml. Perhaps set up a directory (like public) for the user to place their added files into (data, rb files, etc)?

diminish7 commented 14 years ago

Cool, I'll take a look at it. I think going with config.yaml for gems is probably the right approach. I'm not sure it's worth the effort to do it automatically.

bil-bas commented 14 years ago

Yeah, I'm more than happy with making users list gems manually. Not perfect, but we can always do it automatically later if we wish to.

diminish7 commented 14 years ago

Done - added a gems section to config.yaml.

Note that adding additional ruby files works out of the box with warbler: just need to add them to the lib folder and warbler automatically includes them in the war.