Sha256: e8f9f8724b5294a96c859424af6f9a2804449a3c4c91dd4d197d75364595b03d

Contents?: true

Size: 866 Bytes

Versions: 2

Compression:

Stored size: 866 Bytes

Contents

# utility task to lay down packaging artifact files from erb templates
namespace :package do
  task :template, :workdir do |t, args|
    workdir = args.workdir

    if @build.templates
      if @build.templates.is_a?(Array)
        templates = FileList[@build.templates.map {|path| File.join(workdir, path)}]
      else
        STDERR.puts "templates must be an Array, not '#{@build.templates.class}'"
      end
    else
      templates = FileList["#{workdir}/ext/**/*.erb"].exclude(/#{workdir}\/ext\/(packaging|osx)/)
    end

    templates.each do |template|
      # process the template, stripping off the ERB extension
      if File.extname(template) == ".erb"
        erb(template, template.gsub(/\.erb$/,""))
        rm_f(template)
      else
        STDERR.puts "Skipping #{template} because it doesn't look like an erb template"
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
puppet-2.7.25 ext/packaging/tasks/template.rake
puppet-2.7.24 ext/packaging/tasks/template.rake