From 011b2849b8fcbe1605a0172d480026feef6ded84 Mon Sep 17 00:00:00 2001 From: Robert Francis Date: Mon, 28 Jan 2019 21:35:57 +0000 Subject: [PATCH] rename module to CID #22 --- lib/ex_cid.ex | 6 +++--- mix.exs | 4 ++-- test/ex_cid_test.exs | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/ex_cid.ex b/lib/ex_cid.ex index 2251591..39df2a6 100644 --- a/lib/ex_cid.ex +++ b/lib/ex_cid.ex @@ -1,4 +1,4 @@ -defmodule ExCid do +defmodule Cid do @moduledoc """ Provides a way for a user to turn a String, Map or Struct into a CID that is identical to one what will be returned from IPFS if the same data is @@ -16,10 +16,10 @@ defmodule ExCid do ## Examples - iex> ExCid.cid("hello") + iex> Cid.cid("hello") "zb2rhcc1wJn2GHDLT2YkmPq5b69cXc2xfRZZmyufbjFUfBkxr" - iex> ExCid.cid(%{key: "value"}) + iex> Cid.cid(%{key: "value"}) "zb2rhkN6szWhAmBFjjP8RSczv2YVNLnG1tz1Q7FyfEp8LssNZ" """ def cid(value) do diff --git a/mix.exs b/mix.exs index 43bd7fc..d1cdf78 100644 --- a/mix.exs +++ b/mix.exs @@ -1,9 +1,9 @@ -defmodule ExCid.MixProject do +defmodule Cid.MixProject do use Mix.Project def project do [ - app: :ex_cid, + app: :cid, version: "0.1.0", elixir: "~> 1.7", start_permanent: Mix.env() == :prod, diff --git a/test/ex_cid_test.exs b/test/ex_cid_test.exs index 55b7257..1649cb5 100644 --- a/test/ex_cid_test.exs +++ b/test/ex_cid_test.exs @@ -1,25 +1,25 @@ defmodule ExCidTest do use ExUnit.Case - doctest ExCid + doctest Cid defstruct [:a] describe "Testing ex_cid function" do test "ExCid.cid returns the same CID as IPFS when given a string" do - assert "zb2rhkpbfTBtUV1ESqSScrUre8Hh77fhCKDLmX21rCo5xp8J9" == ExCid.cid("Hello World") + assert "zb2rhkpbfTBtUV1ESqSScrUre8Hh77fhCKDLmX21rCo5xp8J9" == Cid.cid("Hello World") end test "ExCid.cid returns the same CID as IPFS when given a map" do - assert "zb2rhbYzyUJP6euwn89vAstfgG2Au9BSwkFGUJkbujWztZWjZ" == ExCid.cid(%{a: "a"}) + assert "zb2rhbYzyUJP6euwn89vAstfgG2Au9BSwkFGUJkbujWztZWjZ" == Cid.cid(%{a: "a"}) end test "ExCid.cid returns the same CID as IPFS when given a struct" do - assert "zb2rhbYzyUJP6euwn89vAstfgG2Au9BSwkFGUJkbujWztZWjZ" == ExCid.cid(%__MODULE__{a: "a"}) + assert "zb2rhbYzyUJP6euwn89vAstfgG2Au9BSwkFGUJkbujWztZWjZ" == Cid.cid(%__MODULE__{a: "a"}) end test "DwylCid.cid returns an error if given invalid data type" do - assert ExCid.cid(2) == "invalid data type" + assert Cid.cid(2) == "invalid data type" end end end