I wonder how to properly configure configure blocks in Sinatra DRY mode. I want to:
- When exceptions and errors are not displayed at the factory
- During development, write queries to DB
- When testing, use SQLite db in memory.
I installed the following:
configure :production do set :show_exceptions, false set :raise_errors, false end configure :development do DataMapper::Logger.new($stdout, :debug) end configure :test do DataMapper.setup(:default, "sqlite::memory:") end
But what to put in the configuration block base? Is this the right approach? In addition, I could not find what the correct order of execution of the configuration blocks in Sinatra was.
source share