Sha256: 637fcbdff1404212fa950cb2bc7c489d4f8b70d2da359808e1f640ece42b23e1

Contents?: true

Size: 640 Bytes

Versions: 6

Compression:

Stored size: 640 Bytes

Contents

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

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

    setting :container, reader: true

    plugin :render, views: "app/views"
    plugin :error_handler
    plugin :flow

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

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

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

    def self.root
      container.config.root
    end

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
kanji-web-0.3.1 lib/kanji/application.rb
kanji-web-0.3.0 lib/kanji/application.rb
kanji-web-0.2.2 lib/kanji/application.rb
kanji-web-0.2.1 lib/kanji/application.rb
kanji-web-0.2.0 lib/kanji/application.rb
kanji-web-0.1.0 lib/kanji/application.rb