Current section
36 Versions
Jump to
Current section
36 Versions
Compare versions
6
files changed
+17
additions
-5
deletions
| @@ -3,9 +3,10 @@ | |
| 3 3 | {<<"description">>,<<"Generating sitemap.xml">>}. |
| 4 4 | {<<"elixir">>,<<">= 1.0.0">>}. |
| 5 5 | {<<"files">>, |
| 6 | - [<<"lib/sitemap.ex">>,<<"lib/sitemap/adapters/file.ex">>, |
| 7 | - <<"lib/sitemap/adapters/s3.ex">>,<<"lib/sitemap/adapters/string.ex">>, |
| 8 | - <<"lib/sitemap/builders/file.ex">>,<<"lib/sitemap/builders/indexfile.ex">>, |
| 6 | + [<<"lib/sitemap.ex">>,<<"lib/sitemap/adapters/behaviour.ex">>, |
| 7 | + <<"lib/sitemap/adapters/file.ex">>,<<"lib/sitemap/adapters/s3.ex">>, |
| 8 | + <<"lib/sitemap/adapters/string.ex">>,<<"lib/sitemap/builders/file.ex">>, |
| 9 | + <<"lib/sitemap/builders/indexfile.ex">>, |
| 9 10 | <<"lib/sitemap/builders/indexurl.ex">>,<<"lib/sitemap/builders/url.ex">>, |
| 10 11 | <<"lib/sitemap/config.ex">>,<<"lib/sitemap/consts.ex">>, |
| 11 12 | <<"lib/sitemap/define.ex">>,<<"lib/sitemap/dsl.ex">>, |
| @@ -22,4 +23,4 @@ | |
| 22 23 | [{<<"app">>,<<"xml_builder">>}, |
| 23 24 | {<<"optional">>,false}, |
| 24 25 | {<<"requirement">>,<<">= 0.0.0">>}]}]}. |
| 25 | - {<<"version">>,<<"0.5.9">>}. |
| 26 | + {<<"version">>,<<"0.6.0">>}. |
| @@ -0,0 +1,5 @@ | |
| 1 | + defmodule Sitemap.Adapters.Behaviour do |
| 2 | + use Behaviour |
| 3 | + |
| 4 | + @callback write(name::String.t, data::String.t) :: :ok | {:error, term} |
| 5 | + end |
| @@ -2,6 +2,8 @@ defmodule Sitemap.Adapters.File do | |
| 2 2 | alias Sitemap.Location |
| 3 3 | alias Sitemap.DirNotExists |
| 4 4 | |
| 5 | + @behaviour Sitemap.Adapters.Behaviour |
| 6 | + |
| 5 7 | def write(name, data) do |
| 6 8 | dir = Location.directory(name) |
| 7 9 | cond do |
| @@ -1,2 +1,4 @@ | |
| 1 1 | defmodule Sitemap.Adapters.S3 do |
| 2 | + # @behaviour Sitemap.Adapters.Behaviour |
| 3 | + |
| 2 4 | end |
| @@ -1,6 +1,8 @@ | |
| 1 1 | defmodule Sitemap.Adapters.String do |
| 2 2 | alias Sitemap.Location |
| 3 3 | |
| 4 | + @behaviour Sitemap.Adapters.Behaviour |
| 5 | + |
| 4 6 | def write(name, data) do |
| 5 7 | path = Location.path(name) |
| 6 8 | if Regex.match?(~r/.gz$/, path) do |
Loading more files…