def supported_platforms(ast)
      # Find the supports() method call.
      platforms_ast = field(ast, "supports")
      # Look for the first argument (the node next to the top args_new) and
      # filter out anything with a string_embexpr since that can't be parsed
      # statically. Then grab the static value for both strings and symbols, and
      # finally combine it with the word list (%w{}) analyzer.
      platforms = platforms_ast.xpath("(.//args_new)[1]/../*[not(.//string_embexpr)]").xpath(".//tstring_content|.//symbol/ident") | word_list_values(platforms_ast)
      platforms.map do |platform|
        # For each platform value, look for all arguments after the first, then
        # extract the string literal value.
        versions = platform.xpath("ancestor::args_add[not(args_new)]/*[position()=2]//tstring_content/@value")
        { platform: platform["value"].lstrip, versions: versions.map(&:to_s) }
      end.sort_by { |p| p[:platform] }
    end
def supported_platforms(ast)
      # Find the supports() method call.
      platforms_ast = field(ast, "supports")
      # Look for the first argument (the node next to the top args_new) and
      # filter out anything with a string_embexpr since that can't be parsed
      # statically. Then grab the static value for both strings and symbols, and
      # finally combine it with the word list (%w{}) analyzer.
      platforms = platforms_ast.xpath("(.//args_new)[1]/../*[not(.//string_embexpr)]").xpath(".//tstring_content|.//symbol/ident") | word_list_values(platforms_ast)
      platforms.map do |platform|
        # For each platform value, look for all arguments after the first, then
        # extract the string literal value.
        versions = platform.xpath("ancestor::args_add[not(args_new)]/*[position()=2]//tstring_content/@value")
        { platform: platform["value"].lstrip, versions: versions.map(&:to_s) }
      end.sort_by { |p| p[:platform] }
    end
Platforms declared as supported in cookbook metadata. Returns an array
 of hashes containing the name and version constraints for each platform.

 @param ast [Nokogiri::XML::Node] Document to search from.
 @return [Array<Hash>]