Skip to content

Commit

Permalink
use modern config handling (#44)
Browse files Browse the repository at this point in the history
* use modern config handling

Breaks compatibility with Elixir versions prior to 1.11.

* Bump version to 0.4.0

---------

Co-authored-by: Jayson Vantuyl <[email protected]>
Co-authored-by: Yuri Lukyanov <[email protected]>
Co-authored-by: Yuri Lukyanov <[email protected]>
  • Loading branch information
4 people authored Apr 3, 2024
1 parent 6372c57 commit 65f886e
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions config/config.exs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is responsible for configuring your application
# and its dependencies with the aid of the Mix.Config module.
use Mix.Config
# and its dependencies with the aid of the Config module.
import Config

# This configuration is loaded before any dependency and is restricted
# to this project. If another project depends on this project, this
Expand All @@ -21,4 +21,4 @@ use Mix.Config
# config :logger, level: :info
#

import_config "#{Mix.env()}.exs"
import_config "#{config_env()}.exs"
2 changes: 1 addition & 1 deletion config/dev.exs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
use Mix.Config
import Config
2 changes: 1 addition & 1 deletion config/prod.exs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
use Mix.Config
import Config
2 changes: 1 addition & 1 deletion config/test.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :holidefs,
locales: [
Expand Down
2 changes: 1 addition & 1 deletion lib/holidefs.ex
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ defmodule Holidefs do
fed: "Federal Reserve"
}

@locale_keys Application.get_env(:holidefs, :locales, Map.keys(@all_locales))
@locale_keys Application.compile_env(:holidefs, :locales, Map.keys(@all_locales))
@locales Map.take(@all_locales, @locale_keys)

@doc """
Expand Down
4 changes: 2 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ defmodule Holidefs.Mixfile do
use Mix.Project

@github_url "https://github.com/toggl/holidefs"
@version "0.3.8"
@version "0.4.0"

def project do
[
app: :holidefs,
version: @version,
elixir: "~> 1.5",
elixir: "~> 1.11",
elixirc_paths: elixirc_paths(Mix.env()),
package: package(),
start_permanent: Mix.env() == :prod,
Expand Down

0 comments on commit 65f886e

Please sign in to comment.