diff options
author | Luke Kanies <luke@madstop.com> | 2007-08-23 13:25:40 -0500 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2007-08-23 13:25:40 -0500 |
commit | 724fef1269bd593496bca9827a0ad7d9361e92d4 (patch) | |
tree | 8b8fb73ee625680bcbc3913e2ee007c8b344f44f /lib/puppet/parser/parser_support.rb | |
parent | 3d68ed66ca7545c26b83a4c921d21f5aad710ee0 (diff) | |
download | puppet-724fef1269bd593496bca9827a0ad7d9361e92d4.tar.gz puppet-724fef1269bd593496bca9827a0ad7d9361e92d4.tar.xz puppet-724fef1269bd593496bca9827a0ad7d9361e92d4.zip |
Everything up to the parser (and the Modules) is ready to support multiple environments, including the parser having an environment setting. I have also created my first spec-based tests, for the interpreter (and deleted the old test/unit tests).
Diffstat (limited to 'lib/puppet/parser/parser_support.rb')
-rw-r--r-- | lib/puppet/parser/parser_support.rb | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/puppet/parser/parser_support.rb b/lib/puppet/parser/parser_support.rb index 967508e56..dfc91ba12 100644 --- a/lib/puppet/parser/parser_support.rb +++ b/lib/puppet/parser/parser_support.rb @@ -15,7 +15,7 @@ class Puppet::Parser::Parser AST = Puppet::Parser::AST - attr_reader :file, :interp + attr_reader :file, :version attr_accessor :files @@ -202,11 +202,9 @@ class Puppet::Parser::Parser } end - def initialize(astset = nil) + def initialize(environment) + @environment = environment initvars() - if astset - @astset = astset - end end # Initialize or reset all of our variables. @@ -427,6 +425,7 @@ class Puppet::Parser::Parser # Store the results as the top-level class. newclass("", :code => main) end + @version = Time.now.to_i return @astset ensure @lexer.clear @@ -446,7 +445,8 @@ class Puppet::Parser::Parser end # Add a new file to be checked when we're checking to see if we should be - # reparsed. + # reparsed. This is basically only used by the TemplateWrapper to let the + # parser know about templates that should be parsed. def watch_file(*files) files.each do |file| unless file.is_a? Puppet::Util::LoadedFile @@ -456,5 +456,3 @@ class Puppet::Parser::Parser end end end - -# $Id$ |