Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# SimpleSchema

<!-- MDOC !-->

SimpleSchema は JSON の検証と各データ構造への設定を行うライブラリです。

- [hex.pm](https://hex.pm/packages/simple_schema)
Expand Down
7 changes: 4 additions & 3 deletions lib/simple_schema.ex
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
defmodule SimpleSchema do
@moduledoc """
#{File.read!("README.md")}
"""
@moduledoc "README.md"
|> File.read!()
|> String.split("<!-- MDOC !-->")
|> Enum.fetch!(1)

@type simple_schema :: SimpleSchema.Schema.simple_schema()

Expand Down
37 changes: 28 additions & 9 deletions mix.exs
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
defmodule SimpleSchema.Mixfile do
use Mix.Project

@source_url "https://github.com/gumi/simple_schema"
@version "1.2.0"
@name "SimpleSchema"

def project do
[
app: :simple_schema,
version: "1.2.0",
name: @name,
version: @version,
elixir: "~> 1.9",
elixirc_paths: elixirc_paths(Mix.env()),
description: "Validate JSON and store to a specified data structure",
package: [
maintainers: ["melpon", "kenichirow"],
licenses: ["Apache 2.0"],
links: %{"GitHub" => "https://github.com/gumi/simple_schema"}
],
docs: [main: "SimpleSchema"],
start_permanent: Mix.env() == :prod,
deps: deps(),
source_url: "https://github.com/gumi/simple_schema"
package: package(),
docs: docs(),
deps: deps()
]
end

Expand All @@ -36,4 +36,23 @@ defmodule SimpleSchema.Mixfile do
{:memoize, "~> 1.3"}
]
end

defp package do
[
maintainers: ["melpon", "kenichirow"],
licenses: ["Apache 2.0"],
links: %{
"Changelog" => "#{@source_url}/blob/master/CHANGELOG.md",
"GitHub" => @source_url
}
]
end

defp docs do
[
main: @name,
source_ref: @version,
source_url: @source_url
]
end
end