Sha256: deef3e028bd35adea933a9bb0bb2d94b790e97c7d37e8b83d3232e5edb5a447c
Contents?: true
Size: 522 Bytes
Versions: 46
Compression:
Stored size: 522 Bytes
Contents
# A simple way to turn file names into singletons, # so we don't have tons of copies of each file path around. class Puppet::FileCollection require 'puppet/file_collection/lookup' def self.collection @collection end def initialize @paths = [] @inverse = {} end def index(path) if i = @inverse[path] return i else @paths << path i = @inverse[path] = @paths.length - 1 return i end end def path(index) @paths[index] end @collection = self.new end
Version data entries
46 entries across 46 versions & 3 rubygems