lib/capitate/plugins/templates.rb in capitate-0.2.1 vs lib/capitate/plugins/templates.rb in capitate-0.2.2
- old
+ new
@@ -19,11 +19,10 @@
# ==== Examples
# template.load("memcached/memcached.monitrc.erb")
# put template.load("memcached/memcached.monitrc.erb"), "/tmp/memcached.monitrc"
#
def load(path, override_binding = nil)
-
template_dirs_found = template_dirs.select { |dir| File.exist?("#{dir}/#{path}") }
# Not found anywhere, throw error
if template_dirs_found.empty?
raise "\n\nTemplate not found: #{path}\n\n"
@@ -73,10 +72,10 @@
# Load all possible places for templates
def template_dirs
@template_dir ||= begin
template_dirs = []
template_dirs += fetch(:templates_dirs) if exists?(:templates_dirs)
- template_dirs << [ "." ]
+ template_dirs << "."
template_dirs << project_root if exists?(:project_root)
template_dirs << gem_templates_root
template_dirs
end
end
\ No newline at end of file