From 9525978a6a87ce51455f178834361b8577e17199 Mon Sep 17 00:00:00 2001 From: Chris Welham <71787007+apexatoll@users.noreply.github.com> Date: Wed, 27 Sep 2023 01:56:30 +0100 Subject: [PATCH] Implement application configuration --- lib/kangaru/application.rb | 4 ++++ sig/kangaru/application.rbs | 2 ++ 2 files changed, 6 insertions(+) diff --git a/lib/kangaru/application.rb b/lib/kangaru/application.rb index 819b28a..29f7bf9 100644 --- a/lib/kangaru/application.rb +++ b/lib/kangaru/application.rb @@ -16,6 +16,10 @@ def config @config ||= Config.new end + def configure(&block) + block.call(config) + end + def setup autoloader.setup end diff --git a/sig/kangaru/application.rbs b/sig/kangaru/application.rbs index 90c0c15..4fb5770 100644 --- a/sig/kangaru/application.rbs +++ b/sig/kangaru/application.rbs @@ -12,6 +12,8 @@ module Kangaru def config: -> Config + def configure: { (Config) -> void } -> void + def setup: -> void def run!: (Array[String]) -> void