Description: fix TEMPLATE_ROOT to take into account FHS
 set to ../templates if running the lib from the source tree
 and to /usr/share/yard/templates if running from the system lib
Author: Cédric Boutillier <boutil@debian.org>
Last-Update: 2014-04-01

--- a/lib/yard.rb
+++ b/lib/yard.rb
@@ -5,7 +5,11 @@
   ROOT = File.expand_path(File.dirname(__FILE__))
 
   # The root path for YARD builtin templates
-  TEMPLATE_ROOT = File.join(ROOT, '..', 'templates')
+  if Dir.exists? File.expand_path('../../debian', __FILE__)
+    TEMPLATE_ROOT = File.join(ROOT, '..', 'templates')
+  else
+    TEMPLATE_ROOT = "/usr/share/yard/templates/"
+  end
 
   # @deprecated Use {Config::CONFIG_DIR}
   CONFIG_DIR = File.expand_path('~/.yard')

