Skip to content
Snippets Groups Projects
Unverified Commit e00ef8ed authored by José Valim's avatar José Valim Committed by GitHub
Browse files

Fix Elixir warnings (#62)

parent 76e6a06e
No related branches found
No related tags found
No related merge requests found
use Mix.Config
if :test == Mix.env do
if :test == Mix.env() do
config :logger, backends: []
end
......@@ -174,7 +174,7 @@ defmodule FileSystem.Backends.FSMac do
def parse_line(line) do
[_, _, events, path] = line |> to_string |> String.split(["\t", "="], parts: 4)
{path, events |> String.split(~w|[ , ]|, trim: true) |> Enum.map(&String.to_existing_atom/1)}
{path, events |> String.split(["[", ",", "]"], trim: true) |> Enum.map(&String.to_existing_atom/1)}
end
end
......@@ -9,7 +9,7 @@ defmodule FileSystem.Mixfile do
description: "A file system change watcher wrapper based on [fs](https://github.com/synrc/fs)",
source_url: "https://github.com/falood/file_system",
package: package(),
compilers: [:file_system | Mix.compilers],
compilers: [:file_system | Mix.compilers()],
aliases: ["compile.file_system": &file_system/1],
docs: [
extras: ["README.md"],
......@@ -31,7 +31,7 @@ defmodule FileSystem.Mixfile do
end
defp file_system(_args) do
case :os.type do
case :os.type() do
{:unix, :darwin} -> compile_mac()
_ -> :ok
end
......@@ -45,7 +45,7 @@ defmodule FileSystem.Mixfile do
if Mix.Utils.stale?(Path.wildcard(source), [target]) do
Logger.info "Compiling file system watcher for Mac..."
cmd = "clang -framework CoreFoundation -framework CoreServices -Wno-deprecated-declarations #{source} -o #{target}"
if Mix.shell.cmd(cmd) > 0 do
if Mix.shell().cmd(cmd) > 0 do
Logger.error "Could not compile file system watcher for Mac, try to run #{inspect cmd} manually inside the dependency."
else
Logger.info "Done."
......
......@@ -22,7 +22,7 @@ defmodule FileSystemTest do
File.touch("#{tmp_dir}/b")
assert_receive {:file_event, ^pid, {_path, _events}}, 5000
Port.list
Port.list()
|> Enum.reject(fn port ->
:undefined == port |> Port.info |> Access.get(:os_pid)
end)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment