Skip to content

Commit

Permalink
Lazy load application config
Browse files Browse the repository at this point in the history
  • Loading branch information
apexatoll committed Oct 26, 2023
1 parent e7c2094 commit f198f2d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/kangaru/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@ module Kangaru
class Application
extend Forwardable

attr_reader :paths, :namespace, :config, :database
attr_reader :paths, :namespace, :database

def initialize(source:, namespace:)
@paths = Paths.new(source:)
@namespace = namespace
@config = Config.new

autoloader.setup
end

def config
@config ||= Config.new
end

def configure(env = nil, &block)
return if env && !Kangaru.env?(env)

Expand Down

0 comments on commit f198f2d

Please sign in to comment.