You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I know that a Sinatra app can be built using the Classic or the Modular style, meaning that it will require sinatra for the former and sinatra/base for the latter.
But I was wondering, why does sinatra/main.rb requires sinatra/base?
This is certainly not needed when you're using the Classic or the Modular way, cause in each case this file is loaded either via sinatra.rb (classic) or directly (modular).
The text was updated successfully, but these errors were encountered:
I imagined that this was the case because a module is meant to take care of its own dependencies. In the case of Sinatra/main, that dependency is Sinatra/base. In the case of Sinatra.rb, those dependencies are both base and main.
There's no harm in having a double require: require's smart enough to recognise that a file has already been required and won't re-require.
I know that a Sinatra app can be built using the Classic or the Modular style, meaning that it will require
sinatra
for the former andsinatra/base
for the latter.But I was wondering, why does sinatra/main.rb requires
sinatra/base
?This is certainly not needed when you're using the Classic or the Modular way, cause in each case this file is loaded either via
sinatra.rb (classic)
or directly (modular).The text was updated successfully, but these errors were encountered: