Class: Puppet::ModuleTool::Skeleton

Inherits:
Object
  • Object
show all
Defined in:
lib/vendor/puppet/module_tool/skeleton.rb

Overview

Skeleton

This class provides methods for finding templates for the ‘generate’ action.

Instance Method Summary collapse

Instance Method Details

#custom_pathObject

Return Pathname of custom templates directory.



25
26
27
# File 'lib/vendor/puppet/module_tool/skeleton.rb', line 25

def custom_path
  Pathname(Puppet.settings[:module_working_dir]) + 'skeleton'
end

#default_pathObject

Return Pathname of default template directory.



30
31
32
# File 'lib/vendor/puppet/module_tool/skeleton.rb', line 30

def default_path
  Pathname(__FILE__).dirname + 'skeleton/templates/generator'
end

#pathObject

Return Pathname with ‘generate’ templates.



15
16
17
# File 'lib/vendor/puppet/module_tool/skeleton.rb', line 15

def path
  paths.detect { |path| path.directory? }
end

#pathsObject

Return Pathnames to look for ‘generate’ templates.



20
21
22
# File 'lib/vendor/puppet/module_tool/skeleton.rb', line 20

def paths
  @paths ||= [ custom_path, default_path ]
end