Sha256: 630db3fce9fdd96c280342da51d0b3cffb14babd6b5a36f77d0efc9d84e9661f
Contents?: true
Size: 752 Bytes
Versions: 5
Compression:
Stored size: 752 Bytes
Contents
# # Created by Luke Kanies on 2007-10-22. # Copyright (c) 2007. All rights reserved. require 'puppet/file_serving' require 'puppet/file_serving/fileset' # Define some common methods for FileServing termini. module Puppet::FileServing::TerminusHelper # Create model instances for all files in a fileset. def path2instances(key, path, options = {}) args = [:links, :ignore, :recurse].inject({}) { |hash, param| hash[param] = options[param] if options[param]; hash } Puppet::FileServing::Fileset.new(path, args).files.collect do |file| inst = model.new(File.join(key, file), :path => path, :relative_path => file) inst.links = options[:links] if options[:links] inst end end end
Version data entries
5 entries across 5 versions & 1 rubygems