From fa6494b69ad1b01a9c587c86aa1731f4702f5509 Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Fri, 13 Feb 2009 00:29:07 -0600 Subject: Using the FileCollection where appropriate. This commit just replaces the :file and :line accessors with the use of the new FileCollection Lookup module. This should mean that we've normalized all file names in a given process, which *might* have drastic RAM improvements. For initial simplicity, I've gone with a single global collection of file names, but it's built so it's easy to use individual file collections instead. Signed-off-by: Luke Kanies --- lib/puppet/parser/resource/param.rb | 6 +++++- lib/puppet/parser/resource/reference.rb | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'lib/puppet/parser/resource') diff --git a/lib/puppet/parser/resource/param.rb b/lib/puppet/parser/resource/param.rb index 1a5cfe8fb..7ce58f4c4 100644 --- a/lib/puppet/parser/resource/param.rb +++ b/lib/puppet/parser/resource/param.rb @@ -1,10 +1,14 @@ +require 'puppet/file_collection/lookup' + # The parameters we stick in Resources. class Puppet::Parser::Resource::Param - attr_accessor :name, :value, :source, :line, :file, :add + attr_accessor :name, :value, :source, :add include Puppet::Util include Puppet::Util::Errors include Puppet::Util::MethodHelper + include Puppet::FileCollection::Lookup + def initialize(hash) set_options(hash) requiredopts(:name, :value, :source) diff --git a/lib/puppet/parser/resource/reference.rb b/lib/puppet/parser/resource/reference.rb index cb505d606..bffc03788 100644 --- a/lib/puppet/parser/resource/reference.rb +++ b/lib/puppet/parser/resource/reference.rb @@ -1,7 +1,9 @@ require 'puppet/resource_reference' +require 'puppet/file_collection/lookup' # A reference to a resource. Mostly just the type and title. class Puppet::Parser::Resource::Reference < Puppet::ResourceReference + include Puppet::FileCollection::Lookup include Puppet::Util::MethodHelper include Puppet::Util::Errors -- cgit From a677e26eb1452c08d7724047a18e50f4a654d2cd Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Thu, 2 Apr 2009 19:41:17 -0500 Subject: Fixing all tests that were apparently broken in the 0.24.x merge. Signed-off-by: Luke Kanies --- lib/puppet/parser/resource/reference.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/puppet/parser/resource') diff --git a/lib/puppet/parser/resource/reference.rb b/lib/puppet/parser/resource/reference.rb index cf7e997d8..0c28cf0df 100644 --- a/lib/puppet/parser/resource/reference.rb +++ b/lib/puppet/parser/resource/reference.rb @@ -1,5 +1,5 @@ # A reference to a resource. Mostly just the type and title. -require 'puppet/resource_reference' +require 'puppet/resource/reference' require 'puppet/file_collection/lookup' # A reference to a resource. Mostly just the type and title. -- cgit