Module: Sinatra::Rider::Configuration

Defined in:
lib/sinatra/rider/configuration.rb

Class Method Summary collapse

Class Method Details

.registered(app) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/sinatra/rider/configuration.rb', line 4

def self.registered(app)
  app.configure :development do
    require 'sinatra/rider/quiet_assets'
    require 'sinatra/reloader'
    require 'better_errors'

    app.register Sinatra::Rider::QuietAssets
    app.register Sinatra::Reloader

    %w(app lib).each do |dir|
      Dir.glob("#{File.join(app.root, dir)}/*.rb").each do |file|
        app.also_reload file
      end
    end

    app.use BetterErrors::Middleware
    BetterErrors.application_root = app.root
  end
end