Skip to content

Commit f9e4749

Browse files
committed
change to :ex_knigge to test publish
1 parent 667ab22 commit f9e4749

10 files changed

Lines changed: 34 additions & 33 deletions

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Knigge
2+
23
[![CI](https://github.com/alexocode/knigge/workflows/CI/badge.svg)](https://github.com/alexocode/knigge/actions?query=branch%3Amain+workflow%3ACI)
34
[![Coverage Status](https://coveralls.io/repos/github/alexocode/knigge/badge.svg?branch=main)](https://coveralls.io/github/alexocode/knigge?branch=main)
45
[![Hexdocs.pm](https://img.shields.io/badge/hexdocs-online-blue)](https://hexdocs.pm/knigge/)
@@ -43,7 +44,7 @@ Simply add `knigge` to your list of dependencies in your `mix.exs`:
4344
```elixir
4445
def deps do
4546
[
46-
{:knigge, "~> 1.4"}
47+
{:ex_knigge, "~> 1.4"}
4748
]
4849
end
4950
```

config/test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import Config
22

3-
config :knigge,
3+
config :ex_knigge,
44
delegate_at_runtime?: false

lib/knigge.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ defmodule Knigge do
3232
3333
def deps do
3434
[
35-
{:knigge, "~> 1.4"}
35+
{:ex_knigge, "~> 1.4"}
3636
]
3737
end
3838

lib/knigge/module.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ defmodule Knigge.Module do
4141
iex> #{module}.fetch_for_app(:this_does_not_exist)
4242
{:error, :undefined}
4343
44-
iex> #{module}.fetch_for_app(:knigge)
44+
iex> #{module}.fetch_for_app(:ex_knigge)
4545
{:ok, []}
4646
"""
4747
@spec fetch_for_app(app :: atom()) :: {:ok, list(module())} | {:error, :undefined}

lib/knigge/options.ex

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ defmodule Knigge.Options do
5454
- `[only: <envs>]` - equivalent to the option above
5555
- `[except: <envs>]` - only delegates at runtime if the current environment is __not__ contained in the list
5656
57-
__Default__: `Application.get_env(:knigge, :delegate_at_runtime?, #{inspect(@defaults[:delegate_at_runtime?])})`
57+
__Default__: `Application.get_env(:ex_knigge, :delegate_at_runtime?, #{inspect(@defaults[:delegate_at_runtime?])})`
5858
5959
### `do_not_delegate`
6060
A keyword list defining callbacks for which no delegation should happen.
@@ -70,7 +70,7 @@ defmodule Knigge.Options do
7070
- `[only: <envs>]` - equivalent to the option above
7171
- `[except: <envs>]` - only warns if the current environment is __not__ contained in the list
7272
73-
__Default__: `Application.get_env(:knigge, :warn, #{inspect(@defaults[:warn])})`
73+
__Default__: `Application.get_env(:ex_knigge, :warn, #{inspect(@defaults[:warn])})`
7474
"""
7575

7676
import Keyword, only: [has_key?: 2, keyword?: 1]
@@ -187,7 +187,7 @@ defmodule Knigge.Options do
187187
end
188188

189189
defp defaults_from_config do
190-
:knigge
190+
:ex_knigge
191191
|> Application.get_all_env()
192192
|> Keyword.take([:delegate_at_runtime?, :warn])
193193
end
@@ -225,19 +225,19 @@ defmodule Knigge.Options do
225225
iex> Knigge.Options.validate!(implementation: SomeModule)
226226
[implementation: SomeModule]
227227
228-
iex> Knigge.Options.validate!(otp_app: :knigge)
229-
[otp_app: :knigge]
228+
iex> Knigge.Options.validate!(otp_app: :ex_knigge)
229+
[otp_app: :ex_knigge]
230230
231-
iex> Knigge.Options.validate!(implementation: SomeModule, otp_app: :knigge)
231+
iex> Knigge.Options.validate!(implementation: SomeModule, otp_app: :ex_knigge)
232232
** (ArgumentError) Knigge expects either the :implementation or the :otp_app option but both were given.
233233
234-
iex> Knigge.Options.validate!(otp_app: :knigge, the_answer_to_everything: 42, another_weird_option: 1337)
234+
iex> Knigge.Options.validate!(otp_app: :ex_knigge, the_answer_to_everything: 42, another_weird_option: 1337)
235235
** (ArgumentError) Knigge received unexpected options: [the_answer_to_everything: 42, another_weird_option: 1337]
236236
237237
iex> Knigge.Options.validate!(otp_app: "knigge")
238238
** (ArgumentError) Knigge received invalid value for `otp_app`. Expected atom but received: "knigge"
239239
240-
iex> Knigge.Options.validate!(otp_app: :knigge, delegate_at_runtime?: "test")
240+
iex> Knigge.Options.validate!(otp_app: :ex_knigge, delegate_at_runtime?: "test")
241241
** (ArgumentError) Knigge received invalid value for `delegate_at_runtime?`. Expected boolean or environment (atom or list of atoms) but received: "test"
242242
"""
243243
@spec validate!(opts :: raw()) :: no_return | opts when opts: raw()

lib/knigge/verification/context.ex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,18 @@ defmodule Knigge.Verification.Context do
6262
6363
## Example
6464
65-
iex> {:ok, context} = #{module}.for_app(:knigge)
65+
iex> {:ok, context} = #{module}.for_app(:ex_knigge)
6666
iex> context.app
67-
:knigge
67+
:ex_knigge
6868
iex> context.modules
6969
[]
7070
7171
iex> context = %#{module}{began_at: 123}
72-
iex> {:ok, context} = #{module}.for_app(context, :knigge)
72+
iex> {:ok, context} = #{module}.for_app(context, :ex_knigge)
7373
iex> context.began_at
7474
123
7575
iex> context.app
76-
:knigge
76+
:ex_knigge
7777
iex> context.modules
7878
[]
7979

mix.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ defmodule Knigge.MixProject do
55

66
def project do
77
[
8-
app: :knigge,
8+
app: :ex_knigge,
99
config_path: "config/config.exs",
1010
elixir: ">= 1.18.0 and < 2.0.0",
1111
elixirc_paths: elixirc_paths(Mix.env()),
@@ -18,7 +18,7 @@ defmodule Knigge.MixProject do
1818
dialyzer: dialyzer(),
1919

2020
# Docs
21-
name: "Knigge",
21+
name: "ExKnigge",
2222
source_url: @repo,
2323
homepage_url: @repo,
2424

test/behaviour/with_no_parens_test.exs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@ defmodule Behaviour.WithNoParens do
44
import Knigge.Test.SaltedModule
55

66
test "works fine with a callback without parens" do
7-
Application.put_env(:knigge, :working_behaviour, SomeModule)
7+
Application.put_env(:ex_knigge, :working_behaviour, SomeModule)
88

99
# Should not raise
1010
behaviour =
1111
defmodule_salted WorkingBehaviour do
1212
use Knigge,
13-
otp_app: :knigge,
13+
otp_app: :ex_knigge,
1414
config_key: :working_behaviour
1515

1616
@callback fun :: boolean
1717
end
1818

19-
Application.delete_env(:knigge, :working_behaviour)
19+
Application.delete_env(:ex_knigge, :working_behaviour)
2020

2121
assert behaviour.__knigge__(:implementation) == SomeModule
2222
end

test/behaviour/with_otp_app_key_test.exs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ defmodule Behaviour.WithOtpAppKey do
1414
end
1515

1616
test "works fine with the relevant configuration being set in the Application environment" do
17-
Application.put_env(:knigge, :working_behaviour, SomeModule)
17+
Application.put_env(:ex_knigge, :working_behaviour, SomeModule)
1818

1919
# Should not raise
2020
behaviour =
2121
defmodule_salted WorkingBehaviour do
2222
use Knigge,
23-
otp_app: :knigge,
23+
otp_app: :ex_knigge,
2424
config_key: :working_behaviour
2525
end
2626

27-
Application.delete_env(:knigge, :working_behaviour)
27+
Application.delete_env(:ex_knigge, :working_behaviour)
2828

2929
assert behaviour.__knigge__(:implementation) == SomeModule
3030
end
@@ -34,41 +34,41 @@ defmodule Behaviour.WithOtpAppKey do
3434
behaviour =
3535
defmodule_salted WorkingBehaviour do
3636
use Knigge,
37-
otp_app: :knigge,
37+
otp_app: :ex_knigge,
3838
default: MyApp.SomeModule
3939
end
4040

4141
assert behaviour.__knigge__(:implementation) == MyApp.SomeModule
4242
end
4343

4444
test "ignores default if module is in config" do
45-
Application.put_env(:knigge, :working_behaviour, SomeModule)
45+
Application.put_env(:ex_knigge, :working_behaviour, SomeModule)
4646

4747
# Should not raise
4848
behaviour =
4949
defmodule_salted WorkingBehaviour do
5050
use Knigge,
51-
otp_app: :knigge,
51+
otp_app: :ex_knigge,
5252
config_key: :working_behaviour,
5353
default: AnotherModule
5454
end
5555

56-
Application.delete_env(:knigge, :working_behaviour)
56+
Application.delete_env(:ex_knigge, :working_behaviour)
5757

5858
assert behaviour.__knigge__(:implementation) == SomeModule
5959
end
6060

6161
test "calling my_function/1 delegates the call to the implementation" do
62-
Application.put_env(:knigge, __MODULE__.AGreatBehaviour, AGreatBehaviourMock)
62+
Application.put_env(:ex_knigge, __MODULE__.AGreatBehaviour, AGreatBehaviourMock)
6363

6464
# Should not raise
6565
defmodule AGreatBehaviour do
66-
use Knigge, otp_app: :knigge
66+
use Knigge, otp_app: :ex_knigge
6767

6868
@callback my_function(arg :: any()) :: no_return
6969
end
7070

71-
Application.delete_env(:knigge, __MODULE__.AGreatBehaviour)
71+
Application.delete_env(:ex_knigge, __MODULE__.AGreatBehaviour)
7272

7373
Mox.defmock(AGreatBehaviourMock, for: AGreatBehaviour)
7474
Mox.expect(AGreatBehaviourMock, :my_function, fn arg -> send self(), {:argument, arg} end)

test/knigge/verification_test.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ defmodule Knigge.VerificationTest do
2727

2828
describe ".run/1" do
2929
test "returns a context without an error when passing a context with only `FacadeWithImpl`" do
30-
raw_context = %Context{app: :knigge, modules: [FacadeWithImpl]}
30+
raw_context = %Context{app: :ex_knigge, modules: [FacadeWithImpl]}
3131
context = Verification.run(raw_context)
3232

3333
assert context.existing == [{FacadeWithImpl, FacadeImpl}]
@@ -36,7 +36,7 @@ defmodule Knigge.VerificationTest do
3636
end
3737

3838
test "returns a context containing an error when passing a context with `FacadeWithImpl` and `FacadeWithoutImpl`" do
39-
raw_context = %Context{app: :knigge, modules: [FacadeWithImpl, FacadeWithoutImpl]}
39+
raw_context = %Context{app: :ex_knigge, modules: [FacadeWithImpl, FacadeWithoutImpl]}
4040
context = Verification.run(raw_context)
4141

4242
assert context.existing == [{FacadeWithImpl, FacadeImpl}]

0 commit comments

Comments
 (0)