Skip to content
This repository has been archived by the owner on Feb 13, 2020. It is now read-only.

Commit

Permalink
fix issue with default config
Browse files Browse the repository at this point in the history
  • Loading branch information
foliea committed Dec 27, 2017
1 parent 8c58436 commit 07b636e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/config.cr
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ class Config

private MIN_GRID_SIZE_TRESHOLD = 4_u32

macro generate_default
private DEFAULT_BODY = File.read(File.join(ENV["PWD"], "config/firegrid.toml"))
macro generate_default(body = File.read(File.join(ENV["PWD"], "config/firegrid.toml")))
private def self.default
new({{body}}, filename: "")
end
end

# Load default configuration file content at compile time, as this file won't be available
Expand All @@ -27,7 +29,7 @@ class Config

return new(File.read(filename), filename).tap { |config| config.validate! }
end
new(DEFAULT_BODY, filename: "")
default
end

def initialize(body : String, @filename : String)
Expand Down

0 comments on commit 07b636e

Please sign in to comment.