Skip to content

Commit

Permalink
fixed up docs task
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesse Schoch committed Jan 2, 2015
1 parent 7ee858e commit efb58f2
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 11 deletions.
24 changes: 24 additions & 0 deletions lib/zdb.ex
Original file line number Diff line number Diff line change
@@ -1,13 +1,37 @@
defmodule Zc do
@moduledoc """
record for erlcloud aws_config()
## Example
aws_config(ddb_port: 9001)
"""
require Record
Record.defrecord :aws_config, Record.extract(:aws_config,from_lib: "erlcloud/include/erlcloud_aws.hrl")
end
defmodule Zdb do
defstruct table: "test_table"
require Zc
@doc ~S"""
creates a table. interpolates mix env for you:
table_name = #{Mix.env}_#{table_name}
## Example
Zdb.create(table_name)
"""
def create(name) do
name = "#{Mix.env}_#{name}"
create(name,1,1)
end
@doc ~S"""
creates a table. interpolates mix env: table_name = "#{Mix.env}_#{table_name}"
currently forces hash key and range key values for use with `Zitem`
## Example:
Zdb.create(table_name,read_units,write_units)
"""
def create(name,read_units,write_units,opts \\[]) do
attrDefs = [{"hk",:s},{"rk",:s}]
keySchema = {"hk","rk"}
Expand Down
24 changes: 13 additions & 11 deletions mix.exs
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
defmodule Zdb.Mixfile do
use Mix.Project

@version "0.0.1"
def project do
[app: :zdb,
version: "0.0.1",
version: @version,
elixir: "~> 1.0",
name: "Zdb",
description: " elixir library for dynamodb ",
package: package,
source_url: "https://github.com/jschoch/zdb",
homepage_url: "http://stink.net/zdb",
docs: &docs/0,
docs: [source_ref: "v#{@version}",
source_url: "https://github.com/jschoch/zdb"] ,
deps: deps]
end

Expand All @@ -32,7 +33,8 @@ defmodule Zdb.Mixfile do
# Type `mix help deps` for more examples and options
defp deps do
[{:erlcloud, github: "gleber/erlcloud"},
{:ex_doc, "~> 0.6.2", only: docs},
{:ex_doc, "~> 0.6.2", only: :dev},
{:earmark, ">= 0.0.0",only: :dev},
{:poison, "~> 1.3"}
]
end
Expand All @@ -41,11 +43,11 @@ defmodule Zdb.Mixfile do
licenses: ["MIT"],
links: %{github: "https://github.com/jschoch/zdb"}]
end
defp docs do
{ref, 0} = System.cmd("git", ["rev-parse", "--verify", "--quiet", "HEAD"])
IO.puts "ref: #{inspect ref}"
[source_ref: ref,
#main: "overview",
readme: true]
end
#defp docs do
#{ref, 0} = System.cmd("git", ["rev-parse", "--verify", "--quiet", "HEAD"])
#IO.puts "ref: #{inspect ref}"
#[source_ref: ref,
##main: "overview",
#readme: true]
#end
end

0 comments on commit efb58f2

Please sign in to comment.