Skip to content

Commit

Permalink
Fixed #20
Browse files Browse the repository at this point in the history
  • Loading branch information
grych committed Aug 19, 2017
1 parent aba638a commit 8da7de2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion lib/drab/config.ex
Expand Up @@ -46,7 +46,16 @@ defmodule Drab.Config do
"""
def pubsub() do
#TODO: what if the module is called differently?
Module.concat(app_module(), PubSub)
# Module.concat(app_module(), PubSub)
with {:ok, pubsub_conf} <- Keyword.fetch(Drab.Config.app_config(), :pubsub),
{:ok, name} <- Keyword.fetch(pubsub_conf, :name)
do
name
else
_ -> raise """
Can't find the PubSub module. Please ensure that it exists in the config.exs
"""
end
end

defp first_uppercase?(atom) do
Expand All @@ -69,6 +78,7 @@ defmodule Drab.Config do
DrabTestApp
"""
def app_module() do
# in 1.3 app module is not under the endpoint
Module.split(endpoint())
|> Enum.drop(-1)
|> Module.concat()
Expand Down
2 changes: 1 addition & 1 deletion lib/drab/supervisor.ex
Expand Up @@ -22,7 +22,7 @@ defmodule Drab.Supervisor do
{:module, DrabTestApp} -> [supervisor(DrabTestApp.Endpoint, [])]
end

# Start ETS cache
# Start DETS cache
Drab.Live.Cache.start()

# See http://elixir-lang.org/docs/stable/elixir/Supervisor.html
Expand Down

0 comments on commit 8da7de2

Please sign in to comment.