Sha256: ff7b037603cd51174b7604a2d4c5d155d4b9335743e2d44869f3100a81168bca

Contents?: true

Size: 640 Bytes

Versions: 9

Compression:

Stored size: 640 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

        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
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
dry-web-roda-0.5.1 lib/dry/web/roda/application.rb
dry-web-roda-0.5.0 lib/dry/web/roda/application.rb
dry-web-roda-0.4.0 lib/dry/web/roda/application.rb
dry-web-roda-0.3.0 lib/dry/web/roda/application.rb
dry-web-roda-0.2.3 lib/dry/web/roda/application.rb
dry-web-roda-0.2.2 lib/dry/web/roda/application.rb
dry-web-roda-0.2.1 lib/dry/web/roda/application.rb
dry-web-roda-0.2.0 lib/dry/web/roda/application.rb
dry-web-roda-0.1.0 lib/dry/web/roda/application.rb