Skip to content

Commit d85d537

Browse files
committedMay 8, 2015
update deps. v0.0.6
1 parent 2df010b commit d85d537

File tree

3 files changed

+70
-15
lines changed

3 files changed

+70
-15
lines changed
 

‎all_docs.exs

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
defmodule OfflineDocs do
2+
def parse_dep({dep, constraint}) when constraint |> is_binary, do: parse_dep({dep, constraint, []})
3+
def parse_dep({dep, options}) when options |> is_list, do: parse_dep({dep, "", []})
4+
def parse_dep({dep, _contraint, options}) do
5+
if options[:only] == nil or options[:only] == Mix.env do
6+
[dep: dep]
7+
else
8+
nil
9+
end
10+
end
11+
12+
def add_options(dependency) do
13+
dep = dependency[:dep]
14+
opts = default_opts
15+
|> Keyword.update!(:output, &(&1 <> "#{dep}"))
16+
|> Keyword.update!(:source_root, &(&1 <> "#{dep}"))
17+
|> Keyword.update!(:source_beam, &(&1 <> "#{Mix.env}/lib/#{dep}/ebin"))
18+
dependency
19+
|> Keyword.put(:opts, opts)
20+
end
21+
22+
def generate_docs(dep) do
23+
ExDoc.generate_docs("#{dep[:dep]}", "", dep[:opts])
24+
end
25+
26+
def generate_index(deps) do
27+
links = deps
28+
|> Enum.map(fn dep ->
29+
"<a href=\"#{dep[:dep]}/index.html\">#{dep[:dep]}</a><br />"
30+
end)
31+
|> Enum.join("")
32+
File.write! "docs/index.html", [
33+
"<doctype html><html><body>",
34+
links,
35+
"</body></html>"
36+
]
37+
deps
38+
end
39+
40+
def default_opts do
41+
[output: "docs/",
42+
source_root: "deps/",
43+
source_beam: "_build/",
44+
homepage_url: "",
45+
main: "overview"]
46+
end
47+
end
48+
49+
Mix.Project.config
50+
|> Keyword.get(:deps)
51+
|> Enum.map(&OfflineDocs.parse_dep/1)
52+
|> Enum.filter(&(&1 != nil))
53+
|> Enum.map(&OfflineDocs.add_options/1)
54+
|> OfflineDocs.generate_index
55+
|> Enum.map(&OfflineDocs.generate_docs/1)

‎mix.exs

+7-7
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ defmodule HttpRouter.Mixfile do
33

44
def project do
55
[ app: :http_router,
6-
version: "0.0.5",
6+
version: "0.0.6",
77
elixir: "~> 1.0",
88
deps: deps,
99
name: "HttpRouter",
@@ -20,14 +20,14 @@ defmodule HttpRouter.Mixfile do
2020

2121
defp deps do
2222
[ { :cowboy, "~> 1.0.0" },
23-
{ :plug, "~> 0.9.0" },
24-
{ :poison, "~> 1.3.0" },
23+
{ :plug, "~> 0.12.2" },
24+
{ :poison, "~> 1.4.0" },
2525
{ :xml_builder, "~> 0.0.5" },
26-
{ :earmark, "~> 0.1.10", only: :docs },
27-
{ :ex_doc, "~> 0.6.1", only: :docs },
26+
{ :earmark, "~> 0.1.15", only: :docs },
27+
{ :ex_doc, "~> 0.7.2", only: :docs },
2828
{ :inch_ex, only: :docs },
29-
{ :excoveralls, "~> 0.3.4", only: :test },
30-
{ :dialyze, "~> 0.1.3", only: :test } ]
29+
{ :excoveralls, "~> 0.3.10", only: :test },
30+
{ :dialyze, "~> 0.1.4", only: :test } ]
3131
end
3232

3333
defp description do

‎mix.lock

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
%{"cowboy": {:hex, :cowboy, "1.0.0"},
22
"cowlib": {:hex, :cowlib, "1.0.1"},
3-
"dialyze": {:hex, :dialyze, "0.1.3"},
4-
"earmark": {:hex, :earmark, "0.1.13"},
5-
"ex_doc": {:hex, :ex_doc, "0.6.2"},
6-
"excoveralls": {:hex, :excoveralls, "0.3.8"},
3+
"dialyze": {:hex, :dialyze, "0.1.4"},
4+
"earmark": {:hex, :earmark, "0.1.15"},
5+
"ex_doc": {:hex, :ex_doc, "0.7.2"},
6+
"excoveralls": {:hex, :excoveralls, "0.3.10"},
77
"exjsx": {:hex, :exjsx, "3.1.0"},
8-
"hackney": {:hex, :hackney, "1.0.6"},
8+
"hackney": {:hex, :hackney, "1.1.0"},
99
"idna": {:hex, :idna, "1.0.2"},
1010
"inch_ex": {:hex, :inch_ex, "0.2.4"},
1111
"jsx": {:hex, :jsx, "2.4.0"},
12-
"plug": {:hex, :plug, "0.9.0"},
13-
"poison": {:hex, :poison, "1.3.1"},
12+
"plug": {:hex, :plug, "0.12.2"},
13+
"poison": {:hex, :poison, "1.4.0"},
1414
"ranch": {:hex, :ranch, "1.0.0"},
15-
"ssl_verify_hostname": {:hex, :ssl_verify_hostname, "1.0.1"},
15+
"ssl_verify_hostname": {:hex, :ssl_verify_hostname, "1.0.4"},
1616
"xml_builder": {:hex, :xml_builder, "0.0.5"}}

0 commit comments

Comments
 (0)