A skeleton web application configured to use Sinatra and ActiveRecord
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

App: Move config/app.rb loading early, add base_path

Controllers may need to know base_path to define routes, so we must
be able to change it before loading controllers.

Some late after-app-init configuration mechanism may still be
needed, though.

+9 -5
+9 -5
lib/app.rb
··· 41 41 cattr_accessor :name 42 42 @@name = "App" 43 43 44 + # for controllers to be relative to a global base path 45 + cattr_accessor :base_path 46 + @@base_path = "/" 47 + 44 48 # to be replaced by an absolute url with scheme/domain 45 49 cattr_accessor :base_url 46 50 @@base_url = "/" ··· 156 160 if File.exists?(_c = "#{App.root}/config/#{App.environment}.rb") 157 161 require _c 158 162 end 163 + 164 + # per-app initialization, not specific to environment 165 + if File.exists?(_c = "#{App.root}/config/app.rb") 166 + require _c 167 + end 159 168 end 160 169 161 170 # bring in model base ··· 230 239 App.all_routes[p] = subklass 231 240 end 232 241 end 233 - 234 - # per-app initialization, not specific to environment 235 - if File.exists?(_c = "#{App.root}/config/app.rb") 236 - require _c 237 - end