diff --git a/config/config.exs b/config/config.exs index fd677f1b2e8b2a78bb28e3fae4c4680788e7d0bc..4a99dfdd2d990b7f354e3fb7651e7f9790eea9a0 100644 --- a/config/config.exs +++ b/config/config.exs @@ -1,5 +1,5 @@ use Mix.Config -if :test == Mix.env do +if :test == Mix.env() do config :logger, backends: [] end diff --git a/lib/file_system/backends/fs_mac.ex b/lib/file_system/backends/fs_mac.ex index 4bc876c7dd71d46ffcfe1e0eb92aa276063e5ba9..cd0236a98a52a773c52e1a9f449f488ad94b8f46 100644 --- a/lib/file_system/backends/fs_mac.ex +++ b/lib/file_system/backends/fs_mac.ex @@ -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 diff --git a/mix.exs b/mix.exs index 1dfd96d50c905d4e280fea04f66e9eb067e9c175..c1bc425fcabc4c0ba558802b1d571b0d48f6f4e9 100644 --- a/mix.exs +++ b/mix.exs @@ -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." diff --git a/test/file_system_test.exs b/test/file_system_test.exs index 750b5d36c84b39246af3e2f2b83d21b510e5197f..2026933f5cbc3c879d9aee7f8f1bd6d4dbe74cf4 100644 --- a/test/file_system_test.exs +++ b/test/file_system_test.exs @@ -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)