Sha256: 5b9959c4fcad521e6ee7438b4cb7996f512093a9fa54b810e75360f47c9036f4

Contents?: true

Size: 880 Bytes

Versions: 8

Compression:

Stored size: 880 Bytes

Contents

require "roda"
require "roda/plugins/flow"
require "dry-configurable"

module Dry
  module Web
    module Roda
      class Application < ::Roda
        extend Dry::Configurable

        setting :container
        setting :routes

        plugin :multi_route
        plugin :flow
        plugin :error_handler

        def self.configure(&block)
          super.tap do
            use(config.container[:rack_monitor])
          end
        end

        def self.resolve(name)
          config.container[name]
        end

        def self.[](name)
          resolve(name)
        end

        def self.load_routes!
          Dir[root.join("#{config.routes}/**/*.rb")].each { |f| require f }
        end

        def self.root
          config.container.config.root
        end

        def notifications
          self.class[:notifications]
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
dry-web-roda-0.7.4 lib/dry/web/roda/application.rb
dry-web-roda-0.7.3 lib/dry/web/roda/application.rb
dry-web-roda-0.7.2 lib/dry/web/roda/application.rb
dry-web-roda-0.7.1 lib/dry/web/roda/application.rb
dry-web-roda-0.7.0 lib/dry/web/roda/application.rb
dry-web-roda-0.6.3 lib/dry/web/roda/application.rb
dry-web-roda-0.6.2 lib/dry/web/roda/application.rb
dry-web-roda-0.6.1 lib/dry/web/roda/application.rb