Skip to content
Browse files

Use Mix.Utils.extract_files

  • Loading branch information...
1 parent 0a9af4e commit d7430ca97ab6f97103f3c2aef721f0699fac2eb4 @josevalim josevalim committed Sep 9, 2012
Showing with 3 additions and 15 deletions.
  1. +3 −15 lib/mix/tasks/compile.dynamo.ex
View
18 lib/mix/tasks/compile.dynamo.ex
@@ -58,8 +58,9 @@ defmodule Mix.Tasks.Compile.Dynamo do
view_paths = dynamo[:view_paths]
source_paths = dynamo[:source_paths] ++ extract_views(view_paths)
- to_compile = extract_files(source_paths, files, [:ex])
- to_watch = extract_files(source_paths, files, compile_exts)
+ files = Enum.map files, File.expand_path(&1)
+ to_compile = Mix.Utils.extract_files(source_paths, files, [:ex])
+ to_watch = Mix.Utils.extract_files(source_paths, files, compile_exts)
targets = [compile_path]
if opts[:force] or Mix.Dynamo.stale_app?(app) or Mix.Utils.stale?(to_watch, targets) do
@@ -82,19 +83,6 @@ defmodule Mix.Tasks.Compile.Dynamo do
end
end
- defp extract_files(paths, [], exts) do
- exts = Enum.join(exts, ",")
- List.concat(lc path inlist paths do
- File.wildcard("#{path}/**/*.{#{exts}}")
- end)
- end
-
- defp extract_files(paths, files, exts) do
- paths = extract_files(paths, [], exts)
- files = Enum.map files, File.expand_path(&1)
- Enum.filter files, List.member?(paths, &1)
- end
-
defp extract_views(view_paths) do
lc view_path inlist view_paths, path = view_path.to_path, do: path
end

0 comments on commit d7430ca

Please sign in to comment.
Something went wrong with that request. Please try again.