Skip to content
This repository was archived by the owner on Dec 17, 2018. It is now read-only.

Commit cc2047f

Browse files
Connor RigbyConnorRigby
Connor Rigby
authored andcommittedJul 31, 2018
Cleanup things that should be private.
1 parent 7280de7 commit cc2047f

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed
 

‎.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
# Where 3rd-party dependencies like ExDoc output generated docs.
1111
/doc/
12+
docs/all.json
1213

1314
# Ignore .fetch files in case you like to edit your project deps locally.
1415
/.fetch

‎lib/esqlite3/esqlite3.ex

+10-7
Original file line numberDiff line numberDiff line change
@@ -219,22 +219,25 @@ defmodule Esqlite3 do
219219
end
220220
end
221221

222+
@doc """
223+
Enumerate results with a function `f`.
224+
"""
222225
def map(f, sql, connection) do
223226
case prepare(sql, connection) do
224227
{:ok, statement} -> map_s(f, statement)
225228
{:error, _} = err -> throw(err)
226229
end
227230
end
228231

229-
def map_s(f, statement) when is_function(f, 1) do
232+
defp map_s(f, statement) when is_function(f, 1) do
230233
case try_step(statement, 0) do
231234
:"$done" -> []
232235
{:error, _} = e -> f.(e)
233236
{:row, row} -> [f.(row) | map_s(f, statement)]
234237
end
235238
end
236239

237-
def map_s(f, statement) when is_function(f, 2) do
240+
defp map_s(f, statement) when is_function(f, 2) do
238241
column_names = column_names(statement)
239242

240243
case try_step(statement, 0) do
@@ -251,7 +254,7 @@ defmodule Esqlite3 do
251254
end
252255
end
253256

254-
def foreach_s(f, statement) when is_function(f, 1) do
257+
defp foreach_s(f, statement) when is_function(f, 1) do
255258
case try_step(statement, 0) do
256259
:"$done" ->
257260
:ok
@@ -265,7 +268,7 @@ defmodule Esqlite3 do
265268
end
266269
end
267270

268-
def foreach_s(f, statement) when is_function(f, 2) do
271+
defp foreach_s(f, statement) when is_function(f, 2) do
269272
column_names = column_names(statement)
270273

271274
case try_step(statement, 0) do
@@ -305,11 +308,11 @@ defmodule Esqlite3 do
305308
end
306309
end
307310

308-
def try_step(statement, tries)
311+
defp try_step(statement, tries)
309312

310-
def try_step(_statement, tries) when tries > 5, do: throw(:too_many_tries)
313+
defp try_step(_statement, tries) when tries > 5, do: throw(:too_many_tries)
311314

312-
def try_step(statement, tries) do
315+
defp try_step(statement, tries) do
313316
case step(statement) do
314317
:"$busy" ->
315318
:timer.sleep(100 * tries)

‎mix.exs

+2-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ defmodule Esqlite.MixProject do
5555
{:elixir_make, "~> 0.4.1", runtime: false},
5656
{:dialyxir, "~> 0.5.1", runtime: false, only: :dev},
5757
{:excoveralls, "~> 0.8", only: :test, optional: true},
58-
{:ex_doc, "~> 0.18.3", runtime: false, only: :dev}
58+
{:ex_doc, "~> 0.18.3", runtime: false, only: :docs},
59+
{:inch_ex, only: :docs, runtime: false}
5960
]
6061
end
6162
end

‎mix.lock

+2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@
88
"exjsx": {:hex, :exjsx, "4.0.0", "60548841e0212df401e38e63c0078ec57b33e7ea49b032c796ccad8cde794b5c", [:mix], [{:jsx, "~> 2.8.0", [hex: :jsx, repo: "hexpm", optional: false]}], "hexpm"},
99
"hackney": {:hex, :hackney, "1.11.0", "4951ee019df102492dabba66a09e305f61919a8a183a7860236c0fde586134b6", [:rebar3], [{:certifi, "2.0.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "5.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "1.0.1", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "1.0.2", [hex: :mimerl, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "1.1.1", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}], "hexpm"},
1010
"idna": {:hex, :idna, "5.1.0", "d72b4effeb324ad5da3cab1767cb16b17939004e789d8c0ad5b70f3cea20c89a", [:rebar3], [{:unicode_util_compat, "0.3.1", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm"},
11+
"inch_ex": {:hex, :inch_ex, "0.5.6", "418357418a553baa6d04eccd1b44171936817db61f4c0840112b420b8e378e67", [:mix], [{:poison, "~> 1.5 or ~> 2.0 or ~> 3.0", [hex: :poison, repo: "hexpm", optional: false]}], "hexpm"},
1112
"jsx": {:hex, :jsx, "2.8.3", "a05252d381885240744d955fbe3cf810504eb2567164824e19303ea59eef62cf", [:mix, :rebar3], [], "hexpm"},
1213
"metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm"},
1314
"mimerl": {:hex, :mimerl, "1.0.2", "993f9b0e084083405ed8252b99460c4f0563e41729ab42d9074fd5e52439be88", [:rebar3], [], "hexpm"},
15+
"poison": {:hex, :poison, "3.1.0", "d9eb636610e096f86f25d9a46f35a9facac35609a7591b3be3326e99a0484665", [:mix], [], "hexpm"},
1416
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.1", "28a4d65b7f59893bc2c7de786dec1e1555bd742d336043fe644ae956c3497fbe", [:make, :rebar], [], "hexpm"},
1517
"unicode_util_compat": {:hex, :unicode_util_compat, "0.3.1", "a1f612a7b512638634a603c8f401892afbf99b8ce93a45041f8aaca99cadb85e", [:rebar3], [], "hexpm"},
1618
}

0 commit comments

Comments
 (0)