diff --git a/extensions/dns/ruby/rubydns.rb b/extensions/dns/ruby/rubydns.rb index f407b6f7e..bbf2a3669 100644 --- a/extensions/dns/ruby/rubydns.rb +++ b/extensions/dns/ruby/rubydns.rb @@ -5,7 +5,7 @@ # module RubyDNS - # Overrides RubyDNS::run_server() to behave exactly the same, minus the output + # Behaves exactly the same, minus the output def self.run_server(options = {}, &block) server = RubyDNS::Server.new(&block) @@ -28,4 +28,24 @@ module RubyDNS server.fire(:stop) end + class Transaction + + # Behaves exactly the same, except using debug logger instead of info + def respond!(*data) + options = data.last.kind_of?(Hash) ? data.pop : {} + resource_class = options[:resource_class] || @resource_class + + if resource_class == nil + raise ArgumentError, "Could not instantiate resource #{resource_class}!" + end + + @server.logger.debug "Resource class: #{resource_class.inspect}" + resource = resource_class.new(*data) + @server.logger.debug "Resource: #{resource.inspect}" + + append!(resource, options) + end + + end + end