I forked ib-ruby to add better rails support. Until now I have been able to add following things:
Unfortunately I cant use the test suite as i have no paper trading account ATM.
I had to do major changes to the file structure to reflect rails conventions. Basicly I conditionally converted it into an engine, if it is loaded in a rails environment. I'm sure I've broken at least the requires for non-rails users.
If someone wants to help me, I forked at https://github.com/robotex82/ib-ruby. I'd prefer to have the changes pulled back, but I need help with the non-rails stuff.
Thanks for your contribution, Roberto. I looked into your fork, but I need to read up on Rails engines to understand what it is you're doing here and how to best merge it with non-Rails lib.
May I ask, if you do not have IB trading account, how do you intend to use this? AFAIK, it only works against IB account?
I don't have access to the paper trading account, it is being used by someone else.
Basically, a Railsengine is nothing very special. You need a rails engine class, and you have to follow some folder structure (Convention over configuration). That's the reason I had to change the folder structure.
Once you follow these conventions, basic inclusion of features (like models, controllers, views, generators,etc.) works automagically, by putting them in the right place.
A rails engine has the same structure as a rails application and rails, as it is an engine itself.
The first step could be to use the the IB:: namespace for the models instead of IB::Models and relocate them to /app/models instead of having them in /the lib folder.
I pull your fork and had a look at where you are going and one thing I noticed is that you had to move things to conform to the rails conventions. Now I notice that the Engine documentation allows one to do the path mappings in the Engine definitions, so possibly we can do this without breaking all the existing test? Look at the Path section here.
Great to have someone else working on this, thanks for the contribution,
Initial draft of Rails Engine now functional, instructions added to Readme, closing.