Sharing Yaml config files between Sinatra and Rails
I am extracting a Sinatra app out of an existing Rails app into a gem to
be reused in the same Rails app. I would like to leave a config file in
it's current location of Rails.root/config (standard spot) but still use
it from the Sinatra application. How do I do this cleanly?
Currently the Sinatra app's settings.root point to some path deep inside
the vender directory. I assume this is because the Sinatra app is a gem.
This means I have to guess out many directories to go up to find the root
of the Rails app.
Is there a standard way to get the root of the main Rack app that my
Sinatra app is mounted in?
No comments:
Post a Comment