summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser/parser_support.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/parser/parser_support.rb')
-rw-r--r--lib/puppet/parser/parser_support.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/puppet/parser/parser_support.rb b/lib/puppet/parser/parser_support.rb
index 728f75a69..967508e56 100644
--- a/lib/puppet/parser/parser_support.rb
+++ b/lib/puppet/parser/parser_support.rb
@@ -1,3 +1,5 @@
+# I pulled this into a separate file, because I got
+# tired of rebuilding the parser.rb file all the time.
class Puppet::Parser::Parser
require 'puppet/parser/functions'
@@ -442,6 +444,17 @@ class Puppet::Parser::Parser
def string=(string)
@lexer.string = string
end
+
+ # Add a new file to be checked when we're checking to see if we should be
+ # reparsed.
+ def watch_file(*files)
+ files.each do |file|
+ unless file.is_a? Puppet::Util::LoadedFile
+ file = Puppet::Util::LoadedFile.new(file)
+ end
+ @files << file
+ end
+ end
end
# $Id$