Skip to content

Commit

Permalink
Merge branch 'master' into woylie-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
Djordje Atlialp committed Jun 26, 2017
2 parents 4335741 + f311163 commit df5a52e
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog BlueBird

## v0.3.3

- fix `doc_path` and `ignore_headers` config not working

## v0.3.2

- add pipeline configuration
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ It lets you generate API documentation in the [API Blueprint](https://apibluepri

``` elixir
defp deps do
 [{:blue_bird, "~> 0.3.2"}]
 [{:blue_bird, "~> 0.3.3"}]
end
```

Expand Down
14 changes: 7 additions & 7 deletions lib/blue_bird/writer/blueprint.ex
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ defmodule BlueBird.Writer.Blueprint do
alias BlueBird.{ApiDoc, Parameter, Request, Route}
alias Mix.Project

@docs_path Application.get_env(:blue_bird, :docs_path, "docs")
@ignore_headers Application.get_env(:blue_bird, :ignore_headers, [])

@doc """
Writes a `BlueBird.ApiDoc{}` struct to file.
Expand Down Expand Up @@ -40,11 +37,12 @@ defmodule BlueBird.Writer.Blueprint do

@spec get_path :: binary
defp get_path do
Project.load_paths
|> Enum.at(0)
docs_path = Application.get_env(:blue_bird, :docs_path, "docs")

Project.build_path()
|> String.split("_build")
|> Enum.at(0)
|> Path.join(@docs_path)
|> Path.join(docs_path)
end

@doc """
Expand Down Expand Up @@ -300,8 +298,10 @@ defmodule BlueBird.Writer.Blueprint do

@spec filter_headers([{String.t, String.t}]) :: [String.t]
defp filter_headers([_|_] = headers) do
ignore_headers = Application.get_env(:blue_bird, :ignore_headers, [])

Enum.reject(headers, fn({key, _}) ->
key == "content-type" || Enum.member?(@ignore_headers, key)
key == "content-type" || Enum.member?(ignore_headers, key)
end)
end
defp filter_headers(_), do: []
Expand Down
6 changes: 2 additions & 4 deletions lib/mix/tasks/bird.gen.docs.ex
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@ defmodule Mix.Tasks.Bird.Gen.Docs do
docs_path = Application.get_env(:blue_bird, :docs_path, "docs")
docs_theme = Application.get_env(:blue_bird, :docs_theme, "triple")

project_path = Project.load_paths
|> Enum.at(0)
path = Project.build_path()
|> String.split("_build")
|> Enum.at(0)

path = Path.join(project_path, docs_path)
|> Path.join(docs_path)

System.cmd(
"aglio",
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule BlueBird.Mixfile do
use Mix.Project

@version "0.3.2"
@version "0.3.3"
@url "https://github.com/KittyHeaven/blue_bird"
@maintainers [
"Djordje Atlialp",
Expand Down

0 comments on commit df5a52e

Please sign in to comment.