I have a Sinatra application that responds to api calls, and a Rails application that handles the reports and all the pretty stuff like graphs and the website. Both need to have access to a common set of models (e.g. Accounts, Sites, etc.)
My problem is: how do I efficiently share the code between the two applications? For example, if I'm editing the Accounts model in Sinatra, I don't want to have to remember to duplicate the same changes in the Rails app. I'd rather not use Rails Rack mounting as the two applications will be on separate clusters.
I've seen suggestions on StackOverflow about:
The two apps are in different repositories. Basically, I'm first developing the API, then putting on the Account specific logic later in the Rails app (mainly because Rails has a lot more libraries that make it easier to develop these sort of things).
How would you solve this problem?
I'd go for a gem, or rather something gem like, you don't need to publish it, and then use Bundler git dependencies. We do this heavily at Travis CI and it works great, especially with the new "local" git dependencies in Bundler 1.2: http://gembundler.com/man/bundle-config.1.html#LOCAL-GIT-REPOS
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With