diff options
| author | James Turnbull <james@lovedthanlost.net> | 2009-02-26 11:43:39 +1100 |
|---|---|---|
| committer | James Turnbull <james@lovedthanlost.net> | 2009-02-26 11:43:39 +1100 |
| commit | 5f73eb553fd083b558fb9553b0c07b6019d0ccee (patch) | |
| tree | 123ef2a9c7b8aa4e1cd52e6b98d0b3c53d626de6 /lib/puppet/parser/ast | |
| parent | e40aea3c655e698d26c29370227b52c489e6db2b (diff) | |
| download | puppet-5f73eb553fd083b558fb9553b0c07b6019d0ccee.tar.gz puppet-5f73eb553fd083b558fb9553b0c07b6019d0ccee.tar.xz puppet-5f73eb553fd083b558fb9553b0c07b6019d0ccee.zip | |
Fixed #1849 - Ruby 1.9 portability: `when' doesn't like colons, replace with semicolons
Diffstat (limited to 'lib/puppet/parser/ast')
| -rw-r--r-- | lib/puppet/parser/ast/collexpr.rb | 12 | ||||
| -rw-r--r-- | lib/puppet/parser/ast/function.rb | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/lib/puppet/parser/ast/collexpr.rb b/lib/puppet/parser/ast/collexpr.rb index baed325cb..6ade58b7e 100644 --- a/lib/puppet/parser/ast/collexpr.rb +++ b/lib/puppet/parser/ast/collexpr.rb @@ -28,15 +28,15 @@ class CollExpr < AST::Branch # case statements as doing an eval here. code = proc do |resource| case @oper - when "and": code1.call(resource) and code2.call(resource) - when "or": code1.call(resource) or code2.call(resource) - when "==": + when "and"; code1.call(resource) and code2.call(resource) + when "or"; code1.call(resource) or code2.call(resource) + when "==" if resource[str1].is_a?(Array) && form != :exported resource[str1].include?(str2) else resource[str1] == str2 end - when "!=": resource[str1] != str2 + when "!="; resource[str1] != str2 end end @@ -46,12 +46,12 @@ class CollExpr < AST::Branch end case @oper - when "and", "or": + when "and", "or" if form == :exported raise Puppet::ParseError, "Puppet does not currently support collecting exported resources with more than one condition" end oper = @oper.upcase - when "==": oper = "=" + when "=="; oper = "=" else oper = @oper end diff --git a/lib/puppet/parser/ast/function.rb b/lib/puppet/parser/ast/function.rb index fc3797f15..2f768ebdb 100644 --- a/lib/puppet/parser/ast/function.rb +++ b/lib/puppet/parser/ast/function.rb @@ -19,12 +19,12 @@ class Puppet::Parser::AST # Now check that it's been used correctly case @ftype - when :rvalue: + when :rvalue unless Puppet::Parser::Functions.rvalue?(@name) raise Puppet::ParseError, "Function '%s' does not return a value" % @name end - when :statement: + when :statement if Puppet::Parser::Functions.rvalue?(@name) raise Puppet::ParseError, "Function '%s' must be the value of a statement" % |
