changed
CHANGELOG.md
|
@@ -1,5 +1,9 @@
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+ ## 1.0.2
|
4
|
+
|
5
|
+ * Improve error message for missing templates
|
6
|
+
|
3
7
|
## 1.0.1
|
4
8
|
|
5
9
|
* Add `embed_templates/2` for convenience
|
changed
hex_metadata.config
|
@@ -1,7 +1,17 @@
|
1
|
- {<<"app">>,<<"phoenix_template">>}.
|
2
|
- {<<"build_tools">>,[<<"mix">>]}.
|
1
|
+ {<<"links">>,
|
2
|
+ [{<<"GitHub">>,<<"https://github.com/phoenixframework/phoenix_template">>}]}.
|
3
|
+ {<<"name">>,<<"phoenix_template">>}.
|
4
|
+ {<<"version">>,<<"1.0.2">>}.
|
3
5
|
{<<"description">>,<<"Template rendering for Phoenix">>}.
|
4
6
|
{<<"elixir">>,<<"~> 1.9">>}.
|
7
|
+ {<<"app">>,<<"phoenix_template">>}.
|
8
|
+ {<<"licenses">>,[<<"MIT">>]}.
|
9
|
+ {<<"requirements">>,
|
10
|
+ [[{<<"name">>,<<"phoenix_html">>},
|
11
|
+ {<<"app">>,<<"phoenix_html">>},
|
12
|
+ {<<"optional">>,true},
|
13
|
+ {<<"requirement">>,<<"~> 2.14.2 or ~> 3.0">>},
|
14
|
+ {<<"repository">>,<<"hexpm">>}]]}.
|
5
15
|
{<<"files">>,
|
6
16
|
[<<"lib">>,<<"lib/phoenix">>,<<"lib/phoenix/template">>,
|
7
17
|
<<"lib/phoenix/template/exs_engine.ex">>,
|
|
@@ -9,14 +19,4 @@
|
9
19
|
<<"lib/phoenix/template/engine.ex">>,<<"lib/phoenix/template.ex">>,
|
10
20
|
<<".formatter.exs">>,<<"mix.exs">>,<<"README.md">>,<<"LICENSE.md">>,
|
11
21
|
<<"CHANGELOG.md">>]}.
|
12
|
- {<<"licenses">>,[<<"MIT">>]}.
|
13
|
- {<<"links">>,
|
14
|
- [{<<"GitHub">>,<<"https://github.com/phoenixframework/phoenix_template">>}]}.
|
15
|
- {<<"name">>,<<"phoenix_template">>}.
|
16
|
- {<<"requirements">>,
|
17
|
- [[{<<"app">>,<<"phoenix_html">>},
|
18
|
- {<<"name">>,<<"phoenix_html">>},
|
19
|
- {<<"optional">>,true},
|
20
|
- {<<"repository">>,<<"hexpm">>},
|
21
|
- {<<"requirement">>,<<"~> 2.14.2 or ~> 3.0">>}]]}.
|
22
|
- {<<"version">>,<<"1.0.1">>}.
|
22
|
+ {<<"build_tools">>,[<<"mix">>]}.
|
changed
lib/phoenix/template.ex
|
@@ -238,7 +238,15 @@ defmodule Phoenix.Template do
|
238
238
|
if function_exported?(module, :render, 2) do
|
239
239
|
module.render(template <> "." <> format, assigns)
|
240
240
|
else
|
241
|
- raise ArgumentError, "no \"#{template}\" #{format} template defined for #{inspect(module)}"
|
241
|
+ reason =
|
242
|
+ if Code.ensure_loaded?(module) do
|
243
|
+ " (the module exists but does define #{template}/1 nor render/2)"
|
244
|
+ else
|
245
|
+ " (the module does not exist)"
|
246
|
+ end
|
247
|
+
|
248
|
+ raise ArgumentError,
|
249
|
+ "no \"#{template}\" #{format} template defined for #{inspect(module)} #{reason}"
|
242
250
|
end
|
243
251
|
end
|
changed
mix.exs
|
@@ -1,7 +1,7 @@
|
1
1
|
defmodule PhoenixTemplate.MixProject do
|
2
2
|
use Mix.Project
|
3
3
|
|
4
|
- @version "1.0.1"
|
4
|
+ @version "1.0.2"
|
5
5
|
@source_url "https://github.com/phoenixframework/phoenix_template"
|
6
6
|
|
7
7
|
def project do
|