Open simonreed opened 13 years ago
You may want to consider decoupling the tracking, parsing, and server segments, kind of how resque works. require 'pathways'
would load up the tracking code while require 'pathways/server'
would include the sinatra and mongo code. This would mean you could have the pathways gem in your Gemfile without requiring a mongo connection at boot time.
Pass the connection configuration options into Parser which is only called when initialized.
Pathways::Parser.new(options)
At the moment Mongo is required when even just tracking which is wrong.