Skip to content

Commit

Permalink
🔖 Bumped to v2.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdesousa committed May 8, 2022
1 parent a4b167d commit 08e14eb
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 52 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## Changelog for 2.4.0

### Bugfix

* Bugfix: [YAML Provider] fixed bug where it would duplicate apps.
* Bugfix: [YAML Provider] fixed bug where regular lists weren't accepted as values.
* Migrated pipeline from Travis to Github Actions.
* Improved code coverage.
* Updated dependencies.

## Changelog for 2.3.3

### Enhancements
Expand Down
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ hostname in the following order:
1. From the OS environment variable `$MYAPP_HOSTNAME` (can be overriden by the
option `os_env`).
2. From the configuration file e.g:
```elixir
config :myapp,
hostname: "my.custom.host"
```
```elixir
config :myapp,
hostname: "my.custom.host"
```
3. From the default value if it exists (In this case, it would return
`"localhost"`).

Expand Down Expand Up @@ -354,16 +354,16 @@ in the following order:

1. From the OS environment variable `$TEST_MYAPP_PORT`.
2. From the configuration file e.g:
```elixir
config :myapp, Test,
port: 4001
```
```elixir
config :myapp, Test,
port: 4001
```
3. From the OS environment variable `$MYAPP_PORT`.
4. From the configuraton file e.g:
```elixir
config :myapp,
port: 80
```
```elixir
config :myapp,
port: 80
```
5. From the default value if it exists. In our example, `4000`.

The ability of loading different environments allows us to do the following
Expand Down Expand Up @@ -889,7 +889,7 @@ in `mix.exs` (Elixir ≥ 1.9 and Erlang ≥ 22):
```elixir
def deps do
[
{:skogsra, "~> 2.3"}
{:skogsra, "~> 2.4"}
]
end
```
Expand All @@ -899,8 +899,8 @@ If you need YAML config provider support, add the following:
```elixir
def deps do
[
{:skogsra, "~> 2.3"},
{:yamerl, "~> 0.8"}
{:skogsra, "~> 2.4"},
{:yamerl, "~> 0.10"}
]
end
```
Expand All @@ -910,8 +910,8 @@ If you need JSON config provider support, add the following:
```elixir
def deps do
[
{:skogsra, "~> 2.3"},
{:jason, "~> 1.2"}
{:skogsra, "~> 2.4"},
{:jason, "~> 1.3"}
]
end
```
Expand Down
24 changes: 12 additions & 12 deletions lib/skogsra.ex
Original file line number Diff line number Diff line change
Expand Up @@ -192,27 +192,27 @@ defmodule Skogsra do
1. From the OS environment variable `$MYAPP_MYDB_PASSWORD` (can be overriden
by the option `os_env`).
2. From the configuration file e.g:
```
config :myapp,
mydb: [password: "some password"]
```
```
config :myapp,
mydb: [password: "some password"]
```
3. From the default value if it exists (In this case, it would return
`"password"`).
A call to `db_password/1` with namespace `Test` will try to get a value:
1. From the OS environment variable `$TEST_MYAPP_MYDB_PASSWORD`.
2. From the configuration file e.g:
```
config :myapp, Test,
mydb: [password: "some test password"]
```
```
config :myapp, Test,
mydb: [password: "some test password"]
```
3. From the OS environment variable `$MYAPP_MYDB_PASSWORDT`.
4. From the configuraton file e.g:
```
config :myapp,
mydb: [password: "some password"]
```
```
config :myapp,
mydb: [password: "some password"]
```
5. From the default value if it exists. In our example, `"password"`.
"""
# credo:disable-for-next-line Credo.Check.Refactor.CyclomaticComplexity
Expand Down
38 changes: 15 additions & 23 deletions mix.exs
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
defmodule Skogsra.Mixfile do
use Mix.Project

@version "2.3.3"
@version "2.4.0"
@name "Skogsrå"
@description "Manages OS environment variables and application configuration options with ease"
@app :skogsra
@root "https://github.com/gmtprime/skogsra"

def project do
[
app: :skogsra,
name: @name,
app: @app,
version: @version,
elixir: "~> 1.9",
elixirc_paths: elixirc_paths(Mix.env()),
build_embedded: Mix.env() == :prod,
start_permanent: Mix.env() == :prod,
name: "Skogsrå",
dialyzer: dialyzer(),
test_coverage: [tool: ExCoveralls],
preferred_cli_env: [
Expand All @@ -30,57 +33,46 @@ defmodule Skogsra.Mixfile do
#############
# Application

defp elixirc_paths(:test) do
["lib", "test/support"]
end

defp elixirc_paths(_) do
["lib"]
end

def application do
[
extra_applications: [:logger]
]
end

defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]

defp deps do
[
{:yamerl, "~> 0.10", optional: true},
{:jason, "~> 1.3", optional: true},
{:ex_doc, "~> 0.28", only: :dev, runtime: false},
{:yamerl, "~> 0.10", optional: true},
{:credo, "~> 1.6", only: [:dev, :test], runtime: false},
{:dialyxir, "~> 1.1", only: [:dev, :test], runtime: false},
{:ex_doc, "~> 0.28", only: :dev, runtime: false},
{:excoveralls, "~> 0.14", only: :test, runtime: false}
]
end

defp dialyzer do
[
plt_file: {:no_warn, "priv/plts/skogsra.plt"},
plt_file: {:no_warn, "priv/plts/#{@app}.plt"},
plt_add_apps: [:yamerl, :jason]
]
end

#########
# Package

defp description do
"""
Manages OS environment variables and application configuration options with
ease.
"""
end

defp package do
[
description: description(),
description: @description,
files: ["lib", "mix.exs", "README.md", "CHANGELOG.md", ".formatter.exs"],
maintainers: ["Alexander de Sousa"],
licenses: ["MIT"],
links: %{
"Changelog" => "#{@root}/blob/master/CHANGELOG.md",
"Github" => @root
"Github" => @root,
"Sponsor" => "https://github.com/sponsors/alexdesousa"
}
]
end
Expand Down

0 comments on commit 08e14eb

Please sign in to comment.