Sha256: a739102dad46844e07d8ca022c2d346d82e53925178b473acf1ae91c10ef3527

Contents?: true

Size: 782 Bytes

Versions: 5

Compression:

Stored size: 782 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(request, path)
        args = [:links, :ignore, :recurse].inject({}) { |hash, param| hash[param] = request.options[param] if request.options[param]; hash }
        Puppet::FileServing::Fileset.new(path, args).files.collect do |file|
            inst = model.new(File.join(request.key, file), :path => path, :relative_path => file)
            inst.links = request.options[:links] if request.options[:links]
            inst
        end
    end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
puppet-0.24.9 lib/puppet/file_serving/terminus_helper.rb
puppet-0.24.6 lib/puppet/file_serving/terminus_helper.rb
puppet-0.24.7 lib/puppet/file_serving/terminus_helper.rb
puppet-0.24.5 lib/puppet/file_serving/terminus_helper.rb
puppet-0.24.8 lib/puppet/file_serving/terminus_helper.rb