module Mysql2xxxx class XML include ExtraOutputs attr_reader :properties def initialize(options = {}) @properties = Properties.new options end def client @client ||= Client.new properties end # this matches the xml generated by "mysql --xml" # i tried to use builder, but the String#to_xs nonsense got in the way def to_file(f) f.write %{} f.write %{} client.select_each(properties.execute) do |hsh| f.write %{} hsh.each do |k, v| f.write %{#{v.to_s.to_xs}} end f.write %{} end f.write %{} nil end end end