diff options
Diffstat (limited to 'lib/puppet/parser/ast/leaf.rb')
-rw-r--r-- | lib/puppet/parser/ast/leaf.rb | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/lib/puppet/parser/ast/leaf.rb b/lib/puppet/parser/ast/leaf.rb index b73c781e1..07bba1b4c 100644 --- a/lib/puppet/parser/ast/leaf.rb +++ b/lib/puppet/parser/ast/leaf.rb @@ -94,6 +94,7 @@ class Puppet::Parser::AST def initialize(hash) super + # Note that this is an AST::Regex, not a Regexp @value = @value.to_s.downcase unless @value.is_a?(Regex) if @value =~ /[^-\w.]/ raise Puppet::DevError, @@ -101,10 +102,6 @@ class Puppet::Parser::AST end end - def to_classname - to_s.downcase.gsub(/[^-\w:.]/,'').sub(/^\.+/,'') - end - # implementing eql? and hash so that when an HostName is stored # in a hash it has the same hashing properties as the underlying value def eql?(value) @@ -116,25 +113,6 @@ class Puppet::Parser::AST return @value.hash end - def match(value) - return @value.match(value) unless value.is_a?(HostName) - - if value.regex? and self.regex? - # Wow this is some sweet design; maybe a touch of refactoring - # in order here. - return value.value.value == self.value.value - elsif value.regex? # we know if the existing name is not a regex, it won't match a regex - return false - else - # else, we could be either a regex or normal and it doesn't matter - return @value.match(value.value) - end - end - - def regex? - @value.is_a?(Regex) - end - def to_s @value.to_s end |