Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Kirch committed Oct 29, 2018
1 parent d9f7709 commit 7044181
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
_build
deps
18 changes: 9 additions & 9 deletions lib/ex_ftp.ex
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ defmodule ExFtp do
whatelse -> whatelse
end
end
def cd({:sftp, _connection_ref, _pid}, path, create_if_not_exists) do
def cd({:sftp, _connection_ref, _pid}, _path, _) do
raise "cd for sftp not implemented"
end

Expand All @@ -66,8 +66,8 @@ defmodule ExFtp do
ensure_dir(conn, parts)
end

def ensure_dir({:ftp, pid} = conn, dir) when is_list(dir) do
[leaf | parent] = dir
def ensure_dir({:ftp, _pid} = conn, dir) when is_list(dir) do
[_ | parent] = dir

if length(parent) > 0 do
ensure_dir(conn, parent)
Expand Down Expand Up @@ -109,7 +109,7 @@ defmodule ExFtp do
{:ok, listing} = :ftp.ls(pid)
parse_ls(listing |> List.to_string)
end
def ls({:sftp, _, pid}) do
def ls({:sftp, _, _pid}) do
raise "ls without path not implemented in sftp"
end

Expand All @@ -134,18 +134,18 @@ defmodule ExFtp do
end


def is_directory?({:ftp, pid}, path) do
def is_directory?({:ftp, pid}, _path) do
:ftp.ls(pid)
|> case do
{:ok, list} -> true
_ -> false
{:ok, _} -> true
_ -> false
end
end
def is_directory?({:sftp, pid, _}, path) do
:ssh_sftp.list_dir(pid, s_to_l(path))
|> case do
{:ok, list} -> true
_ -> false
{:ok, _} -> true
_ -> false
end
end

Expand Down
4 changes: 3 additions & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ defmodule Ftp.Mixfile do
#
# Type "mix help deps" for more examples and options
defp deps do
[]
[
{:timex, "~> 3.0"},
]
end
end
14 changes: 14 additions & 0 deletions mix.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
%{
"certifi": {:hex, :certifi, "2.4.2", "75424ff0f3baaccfd34b1214184b6ef616d89e420b258bb0a5ea7d7bc628f7f0", [:rebar3], [{:parse_trans, "~>3.3", [hex: :parse_trans, repo: "hexpm", optional: false]}], "hexpm"},
"combine": {:hex, :combine, "0.10.0", "eff8224eeb56498a2af13011d142c5e7997a80c8f5b97c499f84c841032e429f", [:mix], [], "hexpm"},
"gettext": {:hex, :gettext, "0.16.0", "4a7e90408cef5f1bf57c5a39e2db8c372a906031cc9b1466e963101cb927dafc", [:mix], [], "hexpm"},
"hackney": {:hex, :hackney, "1.14.3", "b5f6f5dcc4f1fba340762738759209e21914516df6be440d85772542d4a5e412", [:rebar3], [{:certifi, "2.4.2", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "6.0.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.4", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}], "hexpm"},
"idna": {:hex, :idna, "6.0.0", "689c46cbcdf3524c44d5f3dde8001f364cd7608a99556d8fbd8239a5798d4c10", [:rebar3], [{:unicode_util_compat, "0.4.1", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm"},
"metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm"},
"mimerl": {:hex, :mimerl, "1.0.2", "993f9b0e084083405ed8252b99460c4f0563e41729ab42d9074fd5e52439be88", [:rebar3], [], "hexpm"},
"parse_trans": {:hex, :parse_trans, "3.3.0", "09765507a3c7590a784615cfd421d101aec25098d50b89d7aa1d66646bc571c1", [:rebar3], [], "hexpm"},
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.4", "f0eafff810d2041e93f915ef59899c923f4568f4585904d010387ed74988e77b", [:make, :mix, :rebar3], [], "hexpm"},
"timex": {:hex, :timex, "3.4.1", "e63fc1a37453035e534c3febfe9b6b9e18583ec7b37fd9c390efdef97397d70b", [:mix], [{:combine, "~> 0.10", [hex: :combine, repo: "hexpm", optional: false]}, {:gettext, "~> 0.10", [hex: :gettext, repo: "hexpm", optional: false]}, {:tzdata, "~> 0.1.8 or ~> 0.5", [hex: :tzdata, repo: "hexpm", optional: false]}], "hexpm"},
"tzdata": {:hex, :tzdata, "0.5.19", "7962a3997bf06303b7d1772988ede22260f3dae1bf897408ebdac2b4435f4e6a", [:mix], [{:hackney, "~> 1.0", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm"},
"unicode_util_compat": {:hex, :unicode_util_compat, "0.4.1", "d869e4c68901dd9531385bb0c8c40444ebf624e60b6962d95952775cac5e90cd", [:rebar3], [], "hexpm"},
}

0 comments on commit 7044181

Please sign in to comment.