> +                ref = AllReferences[i.name]
> +                ref = @context.find_symbol(i.name) unless ref
> +                ref = ref.viewer if ref and ref.respond_to?(:viewer)
>

Not worth worrying about, but just to note it, this could be simplified to:

                ref = AllReferences[i.name] || @context.find_symbol(i.name)
                ref = ref.viewer if ref.respond_to?(:viewer)



> +            rl = build_realize_list(@context)
> +            @values["realizes"] = rl unless rel.empty?
> +
>

Is this supposed to be ("rl" vs. "rel")?:

            @values["realizes"] = rl unless rl.empty?


> +    def resource_stmt_to_ref(stmt)
> +        type = stmt.type.split("::").collect { |s| s.capitalize
> }.join("::")
> +        title = stmt.title.is_a?(Puppet::Parser::AST::ASTArray) ?
> stmt.title.to_s.gsub(/\[(.*)\]/,'\1') : stmt.title.to_s
> +
> +        param = []
> +        stmt.params.children.each do |p|
> +            res = {}
> +            res["name"] = p.param
> +            res["value"] = "#{p.value.to_s}" unless p.value.nil?
> +
> +            param << res
> +        end
>

Again, just to note it, this could be written:

        param = stmt.params.children.collect do |p|
            res = {"name" => p.param}
            res["value"] = p.value.to_s unless p.value.nil?
            res
        end

or possibly even:

        param = stmt.params.children.collect do |p|
            {"name" => p.param, "value" => p.value.to_s}
        end

 depending on the reason for skipping value if nil.

-- Markus

--

You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.


Reply via email to