title: How to make Thor find templates for system installed .thor files?
body: <p>I've created a <code>.thor</code> script for setting up a new ruby project just the way I like it. I'm using the Thor::Actions <code>directory</code> command to build the app entirely from a template directory structure, as opposed to defining them inline with heredocs. The script directory looks something like this:</p>
  
  <pre><code>rubynu.thor
  template/
    bin/
    lib/
      %app_name%.rb.tt
      %app_name%
    README.markdown
    .gitignore
    ...
  </code></pre>
  
  <p>This works really great, and lets me easily visualize and change individual parts of the template as my taste changes. </p>
  
  <p>But I can't figure out a nice way to get thor to find the template directory once the <code>.thor</code> file is system installed using <code>thor install rubynu.thor</code>. Install sticks a copy of the <code>.thor</code> file into <code>~/.thor</code> but ignores the <code>template/</code> directory, and so the templates aren't found anymore. </p>
  
  <p>I don't want to hardcode the <code>source_root</code> path or manually copy over the template directory to <code>~/.thor</code>. Is there something built-in to thor that handles installing templates along with the <code>.thor</code> file? It would be great if they could be packaged together when installed. </p>
  
  <p>If not, what is the nicest way to get around this? Surely there are system installed thor tasks somewhere that use template files. How'd you do it? I suppose I could bypass <code>thor install</code> and provide this as a gem (though that seems like overkill), or bite the bullet and stick all the template definitions inline in a giant <code>.thor</code> file (less pleasant to make changes to the structure later).</p>
  
  <p>For reference, here is the simple <code>.thor</code> file I'm using:</p>
  
  <pre><code>class Rubynu &lt; Thor::Group
    include Thor::Actions
  
    argument :app_name
  
    def self.source_root
      File.dirname(__FILE__)
    end
  
    def apply_directory_template
      directory 'template', app_name
    end
  end
  </code></pre>
  
  <p>Thanks!</p>