Sha256: 6f2350db6abf3f857f5a5b603a236692e2ff5dcee51742206e148822ce8fd0d7

Contents?: true

Size: 895 Bytes

Versions: 49

Compression:

Stored size: 895 Bytes

Contents

module Puppet::ModuleTool

  # = Skeleton
  #
  # This class provides methods for finding templates for the 'generate' action.
  class Skeleton

    # TODO Review whether the 'freeze' feature should be fixed or deleted.
    # def freeze!
    #   FileUtils.rm_fr custom_path rescue nil
    #   FileUtils.cp_r default_path, custom_path
    # end

    # Return Pathname with 'generate' templates.
    def path
      paths.detect { |path| path.directory? }
    end

    # Return Pathnames to look for 'generate' templates.
    def paths
      @paths ||= [ custom_path, default_path ]
    end

    # Return Pathname of custom templates directory.
    def custom_path
      Pathname(Puppet.settings[:module_working_dir]) + 'skeleton'
    end

    # Return Pathname of default template directory.
    def default_path
      Pathname(__FILE__).dirname + 'skeleton/templates/generator'
    end
  end
end

Version data entries

49 entries across 49 versions & 3 rubygems

Version Path
puppet-parse-0.1.4 lib/vendor/puppet/module_tool/skeleton.rb
puppet-parse-0.1.3 lib/vendor/puppet/module_tool/skeleton.rb
puppet-parse-0.1.2 lib/vendor/puppet/module_tool/skeleton.rb
puppet-parse-0.1.1 lib/vendor/puppet/module_tool/skeleton.rb
puppet-2.7.26 lib/puppet/module_tool/skeleton.rb
puppet-2.7.25 lib/puppet/module_tool/skeleton.rb
puppet-2.7.24 lib/puppet/module_tool/skeleton.rb
puppet-3.2.4 lib/puppet/module_tool/skeleton.rb
puppet-2.7.23 lib/puppet/module_tool/skeleton.rb
puppet-3.2.3 lib/puppet/module_tool/skeleton.rb
puppet-3.2.3.rc1 lib/puppet/module_tool/skeleton.rb
puppet-3.2.2 lib/puppet/module_tool/skeleton.rb
puppet-2.7.22 lib/puppet/module_tool/skeleton.rb
puppet-3.2.1 lib/puppet/module_tool/skeleton.rb
puppet-3.2.1.rc1 lib/puppet/module_tool/skeleton.rb
puppet-3.2.0.rc2 lib/puppet/module_tool/skeleton.rb
librarian-puppet-0.9.9 vendor/gems/ruby/1.9.1/gems/puppet-3.1.0/lib/puppet/module_tool/skeleton.rb
puppet-3.2.0.rc1 lib/puppet/module_tool/skeleton.rb
puppet-parse-0.1.0 lib/vendor/puppet/module_tool/skeleton.rb
puppet-parse-0.0.6 lib/vendor/puppet/module_tool/skeleton.rb