Class: Puppet::Module::Tool::Skeleton
- Inherits:
-
Object
- Object
- Puppet::Module::Tool::Skeleton
- Defined in:
- lib/puppet/module/tool/skeleton.rb
Overview
Skeleton
This class provides methods for finding templates for the ‘generate’ action.
Instance Method Summary collapse
-
#custom_path ⇒ Object
Return Pathname of custom templates directory.
-
#default_path ⇒ Object
Return Pathname of default template directory.
-
#path ⇒ Object
Return Pathname with ‘generate’ templates.
-
#paths ⇒ Object
Return Pathnames to look for ‘generate’ templates.
Instance Method Details
#custom_path ⇒ Object
Return Pathname of custom templates directory.
28 29 30 |
# File 'lib/puppet/module/tool/skeleton.rb', line 28 def custom_path Puppet::Module::Tool.working_dir + 'skeleton' end |
#default_path ⇒ Object
Return Pathname of default template directory.
33 34 35 |
# File 'lib/puppet/module/tool/skeleton.rb', line 33 def default_path Puppet::Module::Tool.root + 'templates' + 'generator' end |
#path ⇒ Object
Return Pathname with ‘generate’ templates.
15 16 17 |
# File 'lib/puppet/module/tool/skeleton.rb', line 15 def path paths.detect { |path| path.directory? } end |
#paths ⇒ Object
Return Pathnames to look for ‘generate’ templates.
20 21 22 23 24 25 |
# File 'lib/puppet/module/tool/skeleton.rb', line 20 def paths @paths ||= [ custom_path, default_path ] end |