Hanami Settings Stores v0.1.1

I have pushed v0.1.1 of hanami-settings-stores with added support for json, toml, and yaml configuration files. This would allow you to do something like this:

# config/app.rb

require "hanami"
require "hanami-settings-stores"

module MyApp
  class App < Hanami::App
    config.settings_store = Hanami::Settings::CompositeStore.new(
      Hanami::Settings::FileStore.new(config.root.join("config/environment/default.yml").to_s),
      Hanami::Settings::FileStore.new(config.root.join("config/environment/#{Hanami.env}.yml").to_s),
    )
  end
end

Additionally the file is run through ERB so your configuration files could look something like this:

app_secret: abcdefghijklmnopqrstuvwxyz
database_url: <%= ENV["DATABASE_URL"] %>
5 Likes