I wonder what's the proper way to set the configure blocks in Sinatra the DRY way. What I want is:
- When in production, don't show exceptions and errors
- When in development, log the queries to DB
- When in testing, use in-memory SQLite db.
I've set this like 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 base configuration
block? Is this a proper approach? Also, I couldn't found what's the proper order of execution of configuration blocks in Sinatra.