Lazy isn't in 1.9.3 :(

This commit is contained in:
Thomas Reynolds 2014-08-24 17:35:02 -07:00
parent 84acb50b02
commit 1d5ae59db9

View file

@ -168,7 +168,6 @@ module Middleman
Contract Symbol, String, Maybe[Bool] => Maybe[SourceFile] Contract Symbol, String, Maybe[Bool] => Maybe[SourceFile]
def find(type, path, glob=false) def find(type, path, glob=false)
watchers watchers
.lazy
.select { |d| d.type == type } .select { |d| d.type == type }
.map { |d| d.find(path, glob) } .map { |d| d.find(path, glob) }
.reject { |d| d.nil? } .reject { |d| d.nil? }
@ -183,7 +182,6 @@ module Middleman
Contract Symbol, String => Bool Contract Symbol, String => Bool
def exists?(type, path) def exists?(type, path)
watchers watchers
.lazy
.select { |d| d.type == type } .select { |d| d.type == type }
.any? { |d| d.exists?(path) } .any? { |d| d.exists?(path) }
end end
@ -196,7 +194,6 @@ module Middleman
Contract Symbol, String => Maybe[HANDLER] Contract Symbol, String => Maybe[HANDLER]
def watcher_for_path(type, path) def watcher_for_path(type, path)
watchers watchers
.lazy
.select { |d| d.type == type } .select { |d| d.type == type }
.find { |d| d.exists?(path) } .find { |d| d.exists?(path) }
end end